Package com.jidesoft.hints
Class ListDataIntelliHints<T>
java.lang.Object
com.jidesoft.hints.AbstractIntelliHints
com.jidesoft.hints.AbstractListIntelliHints
com.jidesoft.hints.ListDataIntelliHints<T>
- All Implemented Interfaces:
IntelliHints
ListDataIntelliHints
is a concrete implementation of IntelliHints
. It
provides hints from a known list of data. It is similar to auto complete text field except the list will be filtered
depending on what user types in so far.-
Field Summary
Fields inherited from class com.jidesoft.hints.AbstractListIntelliHints
_keyStrokes
Fields inherited from interface com.jidesoft.hints.IntelliHints
CLIENT_PROPERTY_INTELLI_HINTS
-
Constructor Summary
ConstructorsConstructorDescriptionListDataIntelliHints
(JTextComponent comp, List<T> completionList) ListDataIntelliHints
(JTextComponent comp, T[] completionList) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Compares the context with the object in the completion list.Gets the list of hints.boolean
Checks if it used case sensitive search.void
setCaseSensitive
(boolean caseSensitive) Sets the case sensitive flag.void
setCompletionList
(List<T> completionList) Sets a new list of hints.void
setCompletionList
(T[] completionList) Sets a new list of hints.boolean
updateHints
(Object context) Update hints depending on the context.Methods inherited from class com.jidesoft.hints.AbstractListIntelliHints
createHintsComponent, createList, getDelegateComponent, getDelegateKeyStrokes, getList, getSelectedHint, setListData, setListData
Methods inherited from class com.jidesoft.hints.AbstractIntelliHints
acceptHint, addShowHintsKeyStroke, createPopup, getAllShowHintsKeyStrokes, getCaretPositionForPopup, getCaretRectangleForPopup, getContext, getIntelliHints, getShowHintsDelay, getShowHintsKeyStroke, getTextComponent, hideHintsPopup, isAutoPopup, isFollowCaret, isHintsPopupVisible, isMultilineTextComponent, removeShowHintsKeyStroke, setAutoPopup, setFollowCaret, setHintsEnabled, setShowHintsDelay, showHints, showHintsPopup, updateHints
-
Constructor Details
-
ListDataIntelliHints
-
ListDataIntelliHints
-
-
Method Details
-
getCompletionList
Gets the list of hints.- Returns:
- the list of hints.
-
setCompletionList
Sets a new list of hints.- Parameters:
completionList
- a new list of hints.
-
setCompletionList
Sets a new list of hints.- Parameters:
completionList
- a new array of hints.
-
updateHints
Description copied from interface:IntelliHints
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.- Specified by:
updateHints
in interfaceIntelliHints
- Overrides:
updateHints
in classAbstractIntelliHints
- Parameters:
context
- the current context- Returns:
- true or false. If it is false, hint popup will not be shown.
-
compare
Compares the context with the object in the completion list.- Parameters:
context
- the context returned fromAbstractIntelliHints.getContext()
method.o
- the object in the completion list.- Returns:
- true if the context matches with the object. Otherwise false.
-
isCaseSensitive
public boolean isCaseSensitive()Checks if it used case sensitive search. By default it's false.- Returns:
- if it's case sensitive.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Sets the case sensitive flag. By default, it's false meaning it's a case insensitive search.- Parameters:
caseSensitive
- true or false.
-