JIDE 3.5.15

com.jidesoft.grid
Class TreeTableSearchable

java.lang.Object
  extended by com.jidesoft.swing.Searchable
      extended by com.jidesoft.swing.TableSearchable
          extended by com.jidesoft.grid.JideTableSearchable
              extended by com.jidesoft.grid.ContextSensitiveTableSearchable
                  extended by 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.


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
TreeTableSearchable(JTable table)
           
 
Method Summary
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.
 boolean isRecursive()
          Checks if the searchable is recursive.
 void setRecursive(boolean recursive)
          Sets the recursive attribute.
protected  void setSelectedIndex(int index, boolean incremental)
          Sets the selected index.
 void tableChanged(TableModelEvent e)
           
 
Methods inherited from class com.jidesoft.grid.ContextSensitiveTableSearchable
getValueAt
 
Methods inherited from class com.jidesoft.grid.JideTableSearchable
isNonContiguousCellSelection
 
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
 

Constructor Detail

TreeTableSearchable

public TreeTableSearchable(JTable table)
Method Detail

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 selected
incremental - 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.

JIDE 3.5.15