com.jidesoft.grid
Class TreeTableSearchable
java.lang.Object
com.jidesoft.swing.Searchable
com.jidesoft.swing.TableSearchable
com.jidesoft.grid.JideTableSearchable
com.jidesoft.grid.ContextSensitiveTableSearchable
com.jidesoft.grid.TreeTableSearchable
- All Implemented Interfaces:
- PropertyChangeListener, EventListener, TableModelListener
- Direct Known Subclasses:
- GroupTableSearchable, PropertyTableSearchable
public class TreeTableSearchable
- extends ContextSensitiveTableSearchable
TreeTableSearchable
is a special Searchable that implements Searchable
that
enables the search function in TreeTable.
The only special attribute of TreeTableSearchable is one called recursive. Since TreeTable allows nested tree
hierarchy. If recursive is true, the search will be performed on all rows include children rows. If the child row is
not visible, it will be made visible. If recursive is false, it will only search on the top level rows and didn't
even look at the children rows.
Methods inherited from class com.jidesoft.swing.TableSearchable |
addTableSelection, convertElementToString, getMainIndex, getSearchColumnIndices, installListeners, isActivateKey, isColumnSelectionAllowed, isFindNextKey, isFindPreviousKey, isRowSelectionAllowed, isSearchSelectedRows, isSelectedCellEditable, propertyChange, setMainIndex, setSearchColumnIndices, uninstallListeners |
Methods inherited from class com.jidesoft.swing.Searchable |
addPropertyChangeListener, addSearchableListener, adjustSelectedIndex, cancelHighlightAll, compare, compare, convertToString, createComponentListener, createFocusListener, createKeyListener, createSearchPopup, findAll, findFirst, findFromCursor, findLast, findNext, findPrevious, firePropertyChangeEvent, fireSearchableEvent, getBackground, getComponent, getCurrentIndex, getCursor, getElementAtAsString, getForeground, getMismatchForeground, getPopupLocation, getPopupLocationRelativeTo, getPopupTimeout, getResourceString, getSearchable, getSearchableListeners, getSearchableProvider, getSearchingDelay, getSearchingText, getSearchLabel, getWildcardSupport, hidePopup, highlightAll, isCaseSensitive, isCountMatch, isDeactivateKey, isFindFirstKey, isFindLastKey, isFromStart, isHeavyweightComponentEnabled, isHideSearchPopupOnEvent, isIncrementalSelectKey, isNavigationKey, isPopupVisible, isProcessModelChangeEvent, isRepeats, isReverseOrder, isSearchableListenerInstalled, isSelectAllKey, isWildcardEnabled, keyTypedOrPressed, removePropertyChangeListener, removeSearchableListener, reverseFindFromCursor, searchingTextEmpty, select, setBackground, setCaseSensitive, setCountMatch, setCursor, setCursor, setForeground, setFromStart, setHeavyweightComponentEnabled, setHideSearchPopupOnEvent, setMismatchForeground, setPopupLocation, setPopupLocationRelativeTo, setPopupTimeout, setProcessModelChangeEvent, setRepeats, setReverseOrder, setSearchableProvider, setSearchingDelay, setSearchLabel, setWildcardEnabled, setWildcardSupport, showPopup, textChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeTableSearchable
public TreeTableSearchable(JTable table)
isRecursive
public boolean isRecursive()
- Checks if the searchable is recursive.
- Returns:
- true if searchable is recursive.
setRecursive
public void setRecursive(boolean recursive)
- Sets the recursive attribute.
If PropertyTableSearchable is recursive, it will all property nodes including those are children properties to
find the matching node.
- Parameters:
recursive
- the flag
tableChanged
public void tableChanged(TableModelEvent e)
- Specified by:
tableChanged
in interface TableModelListener
- Overrides:
tableChanged
in class TableSearchable
setSelectedIndex
protected void setSelectedIndex(int index,
boolean incremental)
- Description copied from class:
Searchable
- Sets the selected index. The concrete implementation should call methods on the component to select the element
at the specified index. The incremental flag is used to do multiple select. 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.
- Overrides:
setSelectedIndex
in class JideTableSearchable
- Parameters:
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.
getSelectedIndex
protected int getSelectedIndex()
- Description copied from class:
TableSearchable
- Gets the selected index.
- Overrides:
getSelectedIndex
in class JideTableSearchable
- Returns:
- the selected index.
getElementCount
protected int getElementCount()
- Description copied from class:
Searchable
- Gets the total element count in the component. Different concrete implementation could have different
interpretation of the count. This is totally OK as long as it's consistent in all the methods. For example, the
index parameter in other methods should be always a valid value within the total count.
- Overrides:
getElementCount
in class JideTableSearchable
- Returns:
- the total element count.
getElementAt
protected Object getElementAt(int index)
- Description copied from class:
Searchable
- Gets the element at the specified index. The element could be any data structure that internally used in the
component. The convertElementToString method will give you a chance to convert the element to string which is
used to compare with the string that user types in.
- Overrides:
getElementAt
in class JideTableSearchable
- Parameters:
index
- the index
- Returns:
- the element at the specified index.