public class FileIntelliHints extends AbstractListIntelliHints
FileIntelliHints
is a concrete implementation of IntelliHints
.
It allows user to type in a file patch quickly by providing them the hints based on what
is existed on file system. You can use setFolderOnly(boolean)
to control if
the hints contain only the folders, or folders and files._keyStrokes
CLIENT_PROPERTY_INTELLI_HINTS
Constructor and Description |
---|
FileIntelliHints(javax.swing.text.JTextComponent comp) |
Modifier and Type | Method and Description |
---|---|
void |
acceptHint(java.lang.Object selected)
After user has selected a item in the hints popup, this method will update JTextComponent accordingly to accept
the hint.
|
boolean |
isFolderOnly()
If the hints contain the folder names only.
|
boolean |
isShowFullPath()
If the hints contain the full path.
|
void |
setFolderOnly(boolean folderOnly)
Sets the property of folder only.
|
void |
setShowFullPath(boolean showFullPath)
Sets the property of showing full path.
|
boolean |
updateHints(java.lang.Object value)
Update hints depending on the context.
|
createHintsComponent, createList, getDelegateComponent, getDelegateKeyStrokes, getList, getSelectedHint, setListData, setListData
createPopup, getCaretPositionForPopup, getCaretRectangleForPopup, getContext, getIntelliHints, getShowHintsKeyStroke, getTextComponent, hideHintsPopup, isAutoPopup, isFollowCaret, isHintsPopupVisible, isMultilineTextComponent, setAutoPopup, setFollowCaret, setHintsEnabled, showHints, showHintsPopup
public boolean isFolderOnly()
public void setFolderOnly(boolean folderOnly)
folderOnly
- only provide hints for the folders.public boolean isShowFullPath()
public void setShowFullPath(boolean showFullPath)
showFullPath
- whether show the full path.public boolean updateHints(java.lang.Object value)
IntelliHints
value
- the current contextpublic void acceptHint(java.lang.Object selected)
AbstractIntelliHints
FileIntelliHints
will append the
selected item at the end of the existing text in order to complete a full file path.acceptHint
in interface IntelliHints
acceptHint
in class AbstractIntelliHints
selected
- the hint to be accepted.