org.gnu.gtk
Class TreeModelFilter

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gtk.TreeModel
          extended byorg.gnu.gtk.TreeModelFilter

public class TreeModelFilter
extends TreeModel

Class for filtering the visible rows of a base TreeModel. This class allows the underlying TreeModel to be filtered in 2 ways:

  1. setVisibleColumn(org.gnu.gtk.DataColumnBoolean) - designates a boolean data column in the underlying TreeModel that serves as "visible" marker each row. If the column's value is true, the row will be visible. If the column's value is false, the row will not be visible.
  2. setVisibleMethod(org.gnu.gtk.TreeModelFilterVisibleMethod) - designates a special class which can determine if a given row should be visible.
Once a visible column or method has been set, their is no way of unsetting it.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
protected TreeModelFilter(Handle handle)
          For internal use only.
  TreeModelFilter(TreeModel model)
          Create a new TreeModelFilter using the given TreeModel as the underlying data model.
 
Method Summary
 void clearCache()
          Clear the filter of any cached iterators.
 TreePath convertChildPathToPath(TreePath child)
          Convert the given child TreePath to a path relative to this filter.
 TreePath convertPathToChildPath(TreePath path)
          Convert the given TreePath to a path relative to the child model.
 TreeModel getModel()
          Return the underlying data model.
static Type getType()
          Retrieve the runtime type used by the GLib library.
protected  boolean handleVisibleFunc(Handle model, Handle iter)
           
 void refilter()
          Re-evaluate the visiblity of each row in the underlying data model.
 void setVisibleColumn(DataColumnBoolean column)
          Designate a boolean data column in the underlying TreeModel that will serve as the "visible" marker for each row.
 void setVisibleMethod(TreeModelFilterVisibleMethod method)
          Designate the given TreeModelFilterVisibleMethod object with the reponsibility of determining if the rows in the underlying TreeModel should be visible.
 
Methods inherited from class org.gnu.gtk.TreeModel
addListener, findListener, fireTreeModelEvent, getDataBlockCount, getEventListenerClass, getEventType, getFirstIter, getIter, getIter, getType, getValue, getValue, getValue, getValue, getValue, gtk_tree_model_get_column_type, gtk_tree_model_get_iter_first, gtk_tree_model_get_iter_from_string, gtk_tree_model_get_iter, gtk_tree_model_get_n_columns, gtk_tree_model_get_path, gtk_tree_model_get_string_from_iter, gtk_tree_model_get_value, gtk_tree_model_iter_children, gtk_tree_model_iter_has_child, gtk_tree_model_iter_n_children, gtk_tree_model_iter_next, gtk_tree_model_iter_nth_child, gtk_tree_model_iter_parent, removeListener
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeModelFilter

protected TreeModelFilter(Handle handle)
For internal use only.


TreeModelFilter

public TreeModelFilter(TreeModel model)
Create a new TreeModelFilter using the given TreeModel as the underlying data model.

Method Detail

setVisibleMethod

public void setVisibleMethod(TreeModelFilterVisibleMethod method)
Designate the given TreeModelFilterVisibleMethod object with the reponsibility of determining if the rows in the underlying TreeModel should be visible.

NOTE: There is no unset method.


handleVisibleFunc

protected boolean handleVisibleFunc(Handle model,
                                    Handle iter)

setVisibleColumn

public void setVisibleColumn(DataColumnBoolean column)
Designate a boolean data column in the underlying TreeModel that will serve as the "visible" marker for each row. If the column's value is true, the row will be visible. If the column's value is false, the row will not be visible.

NOTE: There is no unset method.


getModel

public TreeModel getModel()
Return the underlying data model.


refilter

public void refilter()
Re-evaluate the visiblity of each row in the underlying data model. This should be called after changing the values in the underlying data model.


clearCache

public void clearCache()
Clear the filter of any cached iterators. This should almost never be called.


convertChildPathToPath

public TreePath convertChildPathToPath(TreePath child)
Convert the given child TreePath to a path relative to this filter.


convertPathToChildPath

public TreePath convertPathToChildPath(TreePath path)
Convert the given TreePath to a path relative to the child model.


getType

public static Type getType()
Retrieve the runtime type used by the GLib library.