## org.gnu.gtk
Class TreeModel

    java.lang.Object
      org.gnu.glib.GObject
          org.gnu.gtk.TreeModel

Direct Known Subclasses:
  ListStore, TreeModelFilter, TreeModelSort, TreeStore

public class TreeModel
extends GObject

A generic tree interface for use with `TreeView` widgets. Internally, the `TreeStore` and `ListStore` objects are constructed on top of TreeModels. If you were using the C version of gtk, you would be able to construct other objects like those (although I find no reason for doing so). This object provides a number of useful methods which can be used with either the TreeStore or ListStore.

For a full overview of the tree, list and table widgets, please see the `TreeView` description.

Field Summary

Fields inherited from class org.gnu.glib.GObject
`eventsInitialized`

Constructor Summary
`protected` `TreeModel(Handle handle)`

Method Summary
`void` `addListener(TreeModelListener listener)` Register an object to handle button events.
`protected static int` `findListener(java.util.Vector list, java.lang.Object listener)` Give us a way to locate a specific listener in a Vector.
`protected void` `fireTreeModelEvent(TreeModelEvent event)`
`int` `getDataBlockCount()` Returns the number of data blocks supported by the model
`java.lang.Class` `getEventListenerClass(java.lang.String signal)`
`EventType` `getEventType(java.lang.String signal)`
`TreeIter` `getFirstIter()` Returns the iterator at the start of the model (the one at the path "0"), or returns `null` if the tree is empty.
`TreeIter` `getIter(java.lang.String pathString)` Returns a valid iterator pointing to the path represented by `pathString`, or returns `null` if the path is invalid.
`TreeIter` `getIter(TreePath path)` Returns a valid iterator pointing to `path`, or `null`/
`Type` `getType(int index)` Returns the type of the data block.
`boolean` `getValue(TreeIter iter, DataColumnBoolean dataBlock)` Returns the Value at the given iter in the specified data block.
`double` `getValue(TreeIter iter, DataColumnDouble dataBlock)` Returns the Value at the given iter in the specified data block.
`int` `getValue(TreeIter iter, DataColumnInt dataBlock)` Returns the Value at the given iter in the specified data block.
`java.lang.Object` `getValue(TreeIter iter, DataColumnObject dataBlock)` Returns the Value at the given iter in the specified data block.
`java.lang.String` `getValue(TreeIter iter, DataColumnString dataBlock)` Returns the Value at the given iter in the specified data block.
`protected static int` `gtk_tree_model_get_column_type(Handle treeModel, int index)`
`protected static Handle` `gtk_tree_model_get_iter_first(Handle treeModel)`
`protected static Handle` `gtk_tree_model_get_iter_from_string(Handle treeModel, java.lang.String pathString)`
`protected static Handle` `gtk_tree_model_get_iter(Handle treeModel, Handle path)`
`protected static int` `gtk_tree_model_get_n_columns(Handle treeModel)`
`protected static Handle` `gtk_tree_model_get_path(Handle treeModel, Handle iter)`
`protected static java.lang.String` `gtk_tree_model_get_string_from_iter(Handle treeModel, Handle iter)`
`protected static Handle` `gtk_tree_model_get_value(Handle treeModel, Handle iter, int column)`
`protected static Handle` `gtk_tree_model_iter_children(Handle treeModel, Handle parent)`
`protected static boolean` `gtk_tree_model_iter_has_child(Handle treeModel, Handle iter)`
`protected static int` `gtk_tree_model_iter_n_children(Handle treeModel, Handle iter)`
`protected static Handle` `gtk_tree_model_iter_next(Handle treeModel, Handle iter)`
`protected static Handle` `gtk_tree_model_iter_nth_child(Handle treeModel, Handle parent, int n)`
`protected static Handle` `gtk_tree_model_iter_parent(Handle treeModel, Handle child)`
`void` `removeListener(TreeModelListener listener)` Removes a listener

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

### TreeModel

    protected TreeModel(Handle handle)

Method Detail

### getDataBlockCount

    public int getDataBlockCount()

  Returns the number of data blocks supported by the model

### getType

    public Type getType(int index)

  Returns the type of the data block.

  Parameters:
    `index` - The index of the data block

### getIter

    public TreeIter getIter(TreePath path)

  Returns a valid iterator pointing to `path`, or `null`/

### getIter

    public TreeIter getIter(java.lang.String pathString)

  Returns a valid iterator pointing to the path represented by `pathString`, or returns `null` if the path is invalid.

### getFirstIter

    public TreeIter getFirstIter()

  Returns the iterator at the start of the model (the one at the path "0"), or returns `null` if the tree is empty.

### getValue

    public java.lang.String getValue(TreeIter iter,
                                     DataColumnString dataBlock)

  Returns the Value at the given iter in the specified data block.

### getValue

    public int getValue(TreeIter iter,
                        DataColumnInt dataBlock)

  Returns the Value at the given iter in the specified data block.

### getValue

    public boolean getValue(TreeIter iter,
                            DataColumnBoolean dataBlock)

  Returns the Value at the given iter in the specified data block.

### getValue

    public double getValue(TreeIter iter,
                           DataColumnDouble dataBlock)

  Returns the Value at the given iter in the specified data block.

### getValue

    public java.lang.Object getValue(TreeIter iter,
                                     DataColumnObject dataBlock)

  Returns the Value at the given iter in the specified data block.

### addListener

    public void addListener(TreeModelListener listener)

  Register an object to handle button events.

  See Also:
    `TreeModelListener`

### removeListener

    public void removeListener(TreeModelListener listener)

  Removes a listener

  See Also:
    `addListener(TreeModelListener)`

### findListener

    protected static int findListener(java.util.Vector list,
                                      java.lang.Object listener)

  Give us a way to locate a specific listener in a Vector.

  Parameters:
    `list` - The Vector of listeners to search.
    `listener` - The object that is to be located in the Vector.
  Returns:
    Returns the index of the listener in the Vector, or -1 if the listener is not contained in the Vector.

### fireTreeModelEvent

    protected void fireTreeModelEvent(TreeModelEvent event)

### getEventListenerClass

    public java.lang.Class getEventListenerClass(java.lang.String signal)

  Overrides:
    `getEventListenerClass` in class `GObject`

### getEventType

    public EventType getEventType(java.lang.String signal)

  Overrides:
    `getEventType` in class `GObject`

### gtk_tree_model_get_n_columns

    protected static final int gtk_tree_model_get_n_columns(Handle treeModel)

### gtk_tree_model_get_column_type

    protected static final int gtk_tree_model_get_column_type(Handle treeModel,
                                                              int index)

### gtk_tree_model_get_iter

    protected static final Handle gtk_tree_model_get_iter(Handle treeModel,
                                                          Handle path)

### gtk_tree_model_get_iter_from_string

    protected static final Handle gtk_tree_model_get_iter_from_string(Handle treeModel,
                                                                      java.lang.String pathString)

### gtk_tree_model_get_string_from_iter

    protected static final java.lang.String gtk_tree_model_get_string_from_iter(Handle treeModel,
                                                                                Handle iter)

### gtk_tree_model_get_iter_first

    protected static final Handle gtk_tree_model_get_iter_first(Handle treeModel)

### gtk_tree_model_get_path

    protected static final Handle gtk_tree_model_get_path(Handle treeModel,
                                                          Handle iter)

### gtk_tree_model_get_value

    protected static final Handle gtk_tree_model_get_value(Handle treeModel,
                                                           Handle iter,
                                                           int column)

### gtk_tree_model_iter_next

    protected static final Handle gtk_tree_model_iter_next(Handle treeModel,
                                                           Handle iter)

### gtk_tree_model_iter_children

    protected static final Handle gtk_tree_model_iter_children(Handle treeModel,
                                                               Handle parent)

### gtk_tree_model_iter_has_child

    protected static final boolean gtk_tree_model_iter_has_child(Handle treeModel,
                                                                 Handle iter)

### gtk_tree_model_iter_n_children

    protected static final int gtk_tree_model_iter_n_children(Handle treeModel,
                                                              Handle iter)

### gtk_tree_model_iter_nth_child

    protected static final Handle gtk_tree_model_iter_nth_child(Handle treeModel,
                                                                Handle parent,
                                                                int n)

### gtk_tree_model_iter_parent

    protected static final Handle gtk_tree_model_iter_parent(Handle treeModel,
                                                             Handle child)