org.gnu.gtk
Class TreeModel

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by 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.


Method Summary
 void addListener(TreeModelListener listener)
          Register an object to handle button events.
 int getColumnCount()
          Returns the number of data blocks supported by the model
 int getDataBlockCount()
          Deprecated. use getColumnCount instead.
 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, DataColumnIconSize 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.
 long getValue(TreeIter iter, DataColumnLong dataBlock)
          Returns the long at the row specified by iter and column specified data block.
 java.lang.Object getValue(TreeIter iter, DataColumnObject dataBlock)
          Returns the Value at the given iter in the specified data block.
 Pixbuf getValue(TreeIter iter, DataColumnPixbuf dataBlock)
          Returns the Value at the given iter in the specified data block.
 java.lang.String getValue(TreeIter iter, DataColumnStockItem 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.
 void removeListener(TreeModelListener listener)
          Removes a listener
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataBlockCount

public int getDataBlockCount()
Deprecated. use getColumnCount instead.

Returns the number of data blocks supported by the model


getColumnCount

public int getColumnCount()
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 long getValue(TreeIter iter,
                     DataColumnLong dataBlock)
Returns the long at the row specified by iter and column specified data block.

Since:
2.8.5

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.


getValue

public Pixbuf getValue(TreeIter iter,
                       DataColumnPixbuf dataBlock)
Returns the Value at the given iter in the specified data block.


getValue

public int getValue(TreeIter iter,
                    DataColumnIconSize dataBlock)
Returns the Value at the given iter in the specified data block.


getValue

public java.lang.String getValue(TreeIter iter,
                                 DataColumnStockItem 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)

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