JIDE 3.5.15

com.jidesoft.hints
Interface IntelliHints

All Known Implementing Classes:
AbstractCodeEditorIntelliHints, AbstractIntelliHints, AbstractListCodeEditorIntelliHints, AbstractListIntelliHints, FileIntelliHints, ListDataCodeEditorIntelliHints, ListDataIntelliHints

public interface IntelliHints

IntelliHints is an interface that defines all necessary methods to implement showing a hint popup depending on a context and allows user to pick from a list of hints. createHintsComponent() will create a component that contains the hints. It will be shown in a popup window. After hint popup is created, updateHints(Object) will update the content of hints based on the context. Once user picks a hint from the hint popup, getSelectedHint() will be called to find the hint that user selected and call acceptHint(Object) to accept it.


Field Summary
static String CLIENT_PROPERTY_INTELLI_HINTS
          The key of a client property.
 
Method Summary
 void acceptHint(Object hint)
          Accepts the selected hint.
 JComponent createHintsComponent()
          Creates the component which contains hints.
 Object getSelectedHint()
          Gets the selected value.
 boolean updateHints(Object context)
          Update hints depending on the context.
 

Field Detail

CLIENT_PROPERTY_INTELLI_HINTS

static final String CLIENT_PROPERTY_INTELLI_HINTS
The key of a client property. If a component has IntelliHints registered, you can use this client property to get the IntelliHints instance.

See Also:
Constant Field Values
Method Detail

createHintsComponent

JComponent createHintsComponent()
Creates the component which contains hints. At this moment, the content should be empty. Following call updateHints(Object) will update the content.

Returns:
the component which will be used to display the hints.

updateHints

boolean updateHints(Object context)
Update hints depending on the context. This method will be triggered for every key typed event in the text component. Subclass can override it to provide your own list of hints and call setListData to set it and returns true after that.

Parameters:
context - the current context
Returns:
true or false. If it is false, hint popup will not be shown.

getSelectedHint

Object getSelectedHint()
Gets the selected value. This value will be used to complete the text component.

Returns:
the selected value.

acceptHint

void acceptHint(Object hint)
Accepts the selected hint. Subclass can implements to decide how the new hint be set to the text component.

Parameters:
hint - the hint to be accepted.

JIDE 3.5.15