Package com.jidesoft.hints
Interface IntelliHints
-
- All Known Implementing Classes:
AbstractIntelliHints
,AbstractListIntelliHints
,FileIntelliHints
,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, boolean)
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 callacceptHint(Object)
to accept it.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_PROPERTY_INTELLI_HINTS
The key of a client property.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
acceptHint(java.lang.Object hint)
Accepts the selected hint.javax.swing.JComponent
createHintsComponent()
Creates the component which contains hints.java.lang.Object
getSelectedHint()
Gets the selected value.boolean
updateHints(java.lang.Object context)
Deprecated.replaced it by {updateHints(Object, boolean)
}boolean
updateHints(java.lang.Object context, boolean autoPopup)
Update hints depending on the context.
-
-
-
Field Detail
-
CLIENT_PROPERTY_INTELLI_HINTS
static final java.lang.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
javax.swing.JComponent createHintsComponent()
Creates the component which contains hints. At this moment, the content should be empty. Following callupdateHints(Object, boolean)
will update the content.- Returns:
- the component which will be used to display the hints.
-
updateHints
@Deprecated boolean updateHints(java.lang.Object context)
Deprecated.replaced it by {updateHints(Object, boolean)
}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.
-
updateHints
boolean updateHints(java.lang.Object context, boolean autoPopup)
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 contextautoPopup
- true or false. If true, it means this method was called through the auto-popup feature because of the show hint timer is triggered. If false, it means user pressed the show hint key stroke to show the popup.- Returns:
- true or false. If it is false, hint popup will not be shown.
-
getSelectedHint
java.lang.Object getSelectedHint()
Gets the selected value. This value will be used to complete the text component.- Returns:
- the selected value.
-
acceptHint
void acceptHint(java.lang.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.
-
-