com.gwtext.client.widgets.tree
Class TreeFilter

java.lang.Object
  extended by com.gwtext.client.core.JsObject
      extended by com.gwtext.client.widgets.tree.TreeFilter

public class TreeFilter
extends JsObject

Supports filtering of TreePanel nodes.


Field Summary
 
Fields inherited from class com.gwtext.client.core.JsObject
jsObj
 
Constructor Summary
TreeFilter(TreePanel treePanel)
          Create a new TreeFilter.
TreeFilter(TreePanel treePanel, TreeFilterConfig config)
          Create a new TreeFilter.
 
Method Summary
 void clear()
          Clears the current filter.
protected  com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject treePanel, com.google.gwt.core.client.JavaScriptObject config)
           
 void filter(java.lang.String value)
          Filter the data.
 void filter(java.lang.String value, TreeNode startNode)
          Filter the data.
 void filterBy(TreeTraversalCallback callback)
          Filter by a callback function.
 void filterRe(java.lang.String regexp)
          Filter the data.
 void filterRe(java.lang.String regexp, TreeNode startNode)
          Filter the data.
 
Methods inherited from class com.gwtext.client.core.JsObject
getJsObj, getProperties, isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeFilter

public TreeFilter(TreePanel treePanel)
Create a new TreeFilter.

Parameters:
treePanel - the tree panel to filter

TreeFilter

public TreeFilter(TreePanel treePanel,
                  TreeFilterConfig config)
Create a new TreeFilter.

Parameters:
treePanel - the tree panel to filter
config - the TreePanelFilter config
Method Detail

create

protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject treePanel,
                                                             com.google.gwt.core.client.JavaScriptObject config)

clear

public void clear()
Clears the current filter. Note: with the "remove" TreeFilterConfig option set a filter cannot be cleared.


filter

public void filter(java.lang.String value)
Filter the data.

Parameters:
value - the node's text value

filter

public void filter(java.lang.String value,
                   TreeNode startNode)
Filter the data.

Parameters:
value - the node's text
startNode - the node to start filtering from

filterRe

public void filterRe(java.lang.String regexp)
Filter the data.

Parameters:
regexp - regexp to test the node value against

filterRe

public void filterRe(java.lang.String regexp,
                     TreeNode startNode)
Filter the data.

Parameters:
regexp - regexp to test the node value against
startNode - the node to start filtering from

filterBy

public void filterBy(TreeTraversalCallback callback)
Filter by a callback function. The passed function will be called with each node in the tree (or from the startNode). If the callback returns true, the node is kept otherwise it is filtered. If a node is filtered, its children are also filtered.

Parameters:
callback - the filter callback