|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.swing.Searchable com.jidesoft.swing.ComboBoxSearchable com.jidesoft.combobox.ExComboBoxSearchable com.jidesoft.combobox.TreeExComboBoxSearchable
public class TreeExComboBoxSearchable
TreeSearchable
is an concrete implementation of Searchable
that enables the
search function in TreeExComboBox.
It's very simple to use it. Assuming you have a TreeExComboBox, all you need to
do is to call
Now the TreeExComboBox will have the search function.
TreeExComboBox treeExComboBox = ....;
TreeSearchable searchable = new TreeSearchable(treeExComboBox);
TreeExComboBox treeExComboBox = ....;
TreeSearchable searchable = new TreeSearchable(treeExComboBox) {
protected String convertElementToString(Object object) {
...
}
};
Additional customization can be done on the base Searchable class such as background and foreground color,
keystrokes, case sensitivity,
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jidesoft.swing.Searchable |
---|
Searchable.SearchField, Searchable.SearchPopup |
Field Summary |
---|
Fields inherited from class com.jidesoft.swing.Searchable |
---|
_component, _componentListener, _focusListener, _keyListener, _matchCount, CLIENT_PROPERTY_SEARCHABLE, listenerList, PROPERTY_SEARCH_TEXT |
Constructor Summary | |
---|---|
TreeExComboBoxSearchable(TreeExComboBox tree)
|
Method Summary | |
---|---|
protected String |
convertElementToString(Object object)
Converts the element in TreeExComboBox to string. |
protected Object |
getElementAt(int index)
Gets the element at the specified index. |
protected int |
getElementCount()
Gets the total element count in the component. |
protected int |
getSelectedIndex()
Gets the selected index in the component. |
protected List<TreePath> |
getTreePathes()
Gets the cached tree paths list. |
boolean |
isRecursive()
Checks if the searchable is recursive. |
protected void |
populateTreePaths()
Recursively go through the tree to populate the tree paths into a list and cache them. |
void |
propertyChange(PropertyChangeEvent evt)
|
protected void |
resetTreePathes()
Reset the cached tree paths list. |
void |
setRecursive(boolean recursive)
Sets the recursive attribute. |
protected void |
setSelectedIndex(int index,
boolean incremental)
Sets the selected index. |
void |
showPopup(String searchingText)
Shows the search popup. |
void |
treeNodesChanged(TreeModelEvent e)
|
void |
treeNodesInserted(TreeModelEvent e)
|
void |
treeNodesRemoved(TreeModelEvent e)
|
void |
treeStructureChanged(TreeModelEvent e)
|
void |
uninstallListeners()
Uninstall the listeners that installed before. |
Methods inherited from class com.jidesoft.combobox.ExComboBoxSearchable |
---|
getComboBox, popupMenuWillBecomeInvisible |
Methods inherited from class com.jidesoft.swing.ComboBoxSearchable |
---|
contentsChanged, intervalAdded, intervalRemoved, isRefreshPopupDuringSearching, isShowPopupDuringSearching, popupMenuCanceled, popupMenuWillBecomeVisible, setRefreshPopupDuringSearching, setShowPopupDuringSearching |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeExComboBoxSearchable(TreeExComboBox tree)
Method Detail |
---|
public boolean isRecursive()
public void setRecursive(boolean recursive)
recursive
- true or falsepublic void uninstallListeners()
Searchable
uninstallListeners
in class ComboBoxSearchable
public void showPopup(String searchingText)
Searchable
showPopup
in class Searchable
searchingText
- the searching textprotected void setSelectedIndex(int index, boolean incremental)
Searchable
setSelectedIndex
in class ComboBoxSearchable
index
- the index to be selectedincremental
- a flag to enable multiple selection. If the flag is true, the element at the index should be
added to current selection. If false, you should clear previous selection and then select the
element.protected int getSelectedIndex()
Searchable
Here are some examples. In the case of JList, the index is the row index. In the case of JTree, the index is the row index too. In the case of JTable, depending on the selection mode, the index could be row index (in row selection mode), could be column index (in column selection mode) or could the cell index (in cell selection mode).
getSelectedIndex
in class ComboBoxSearchable
protected Object getElementAt(int index)
Searchable
getElementAt
in class ComboBoxSearchable
index
- the index
protected int getElementCount()
Searchable
getElementCount
in class ComboBoxSearchable
protected void populateTreePaths()
protected void resetTreePathes()
protected List<TreePath> getTreePathes()
protected String convertElementToString(Object object)
toString()
of the last path component in the TreePath.
convertElementToString
in class ExComboBoxSearchable
object
- the object. This is usually a TreePath.
public void treeNodesChanged(TreeModelEvent e)
treeNodesChanged
in interface TreeModelListener
public void treeNodesInserted(TreeModelEvent e)
treeNodesInserted
in interface TreeModelListener
public void treeNodesRemoved(TreeModelEvent e)
treeNodesRemoved
in interface TreeModelListener
public void treeStructureChanged(TreeModelEvent e)
treeStructureChanged
in interface TreeModelListener
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
propertyChange
in class ComboBoxSearchable
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |