org.gnu.gtk
public class TreeStore extends TreeModel implements TreeSortable, TreeDragDest, TreeDragSource
Data is stored within this object in DataColumns. This data is displayed in the widgets via CellRenderer's; the mapping between this data and the cell renderers of each treeview column is done in the TreeViewColumn class.
Constructor Summary | |
---|---|
TreeStore(DataColumn[] dataColumns)
Constructs a new TreeStore, defining the types for each datablock.
|
Method Summary | |
---|---|
void | addRow(DataRow aRow)
Adds a row to the tree. |
void | addRow(DataRow aRow, TreeIter aParent)
Adds a row to the tree. |
void | addRowAt(DataRow aRow, int aPosition)
Adds a row to the tree, at the specified position. |
void | addRowAt(DataRow aRow, TreeIter aParent, int aPosition)
Adds a row to the tree, at the specified position. |
TreeIter | appendRow(TreeIter parent)
Appends a new row to tree_store. |
void | clear()
Removes all items from the treestore. |
List | getAllDataColumns()
Returns a List with the types for every column as a
DataColumn object.
|
DataColumn | getDataColumn(int aCol)
Returns the type of the column aCol as a
DataColumn . |
int | getIteratorDepth(TreeIter iter)
Returns the depth of the iterator. |
DataRow | getRowAt(TreeIter aIter)
Gets all the values in the row indicated by aIter . |
DataColumn | getSortColumn()
Get a DataColumn object representing the currently sorted column. |
SortType | getSortOrder()
Get the current sorting order of the store.
|
static Type | getType()
Retrieve the runtime type used by the GLib library. |
int | handleCompareFunc(Handle model, Handle aIter, Handle bIter, int col)
Call-back method invoked by the JNI code when sorting is required. |
TreeIter | insertRow(TreeIter parent, int position)
Creates a new row at position. |
TreeIter | insertRowAfter(TreeIter sibling, TreeIter parent)
Inserts a new row after sibling. |
TreeIter | insertRowBefore(TreeIter sibling, TreeIter parent)
Inserts a new row before sibling. |
boolean | isAncestor(TreeIter iter, TreeIter descendant)
Returns TRUE if iter is an ancestor of descendant. |
boolean | isIterValid(TreeIter iter) |
void | moveRowAfter(TreeIter iter, TreeIter position)
Moves iter in this store to the position after position. |
void | moveRowBefore(TreeIter iter, TreeIter position)
Moves iter in tree_store to the position before position. |
void | moveRowToEnd(TreeIter iter)
Moves iter to the end of the model
|
void | moveRowToStart(TreeIter iter)
Moves iter in this store to the start of the store.
|
TreeIter | prependRow(TreeIter parent)
Prepends a new row to the store. |
void | removeRow(TreeIter iter)
Removes a row from the tree store. |
void | reorder(TreeIter iter, int[] newOrder) |
void | setColumnTypes(DataColumn[] dataColumns) |
void | setDragDestListener(TreeDragDestListener listener)
This method has not yet been implemented. |
void | setDragSourceListener(TreeDragSourceListener listener)
This method has not yet been implemented. |
void | setRowAt(DataRow aRow, TreeIter aIter)
Sets all columns pointed by aIter to the values stored in
aRow .
|
void | setSortColumn(DataColumn column, SortType order)
Set the column in the list to sort on. |
void | setSortMethod(TreeIterComparison method, DataColumn column)
Set the class used to sort the list according to the values stored in the
given DataColumn. |
void | setValue(TreeIter iter, DataColumnString dataBlock, String value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnStockItem dataBlock, GtkStockItem value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnIconSize dataBlock, IconSize value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnInt dataBlock, int value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnLong dataBlock, long value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnBoolean dataBlock, boolean value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnDouble dataBlock, double value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnObject dataBlock, Object value)
Sets a value in the dataStore. |
void | setValue(TreeIter iter, DataColumnPixbuf dataBlock, Pixbuf value)
Sets a value in the dataStore. |
void | swapRows(TreeIter a, TreeIter b)
Swaps a and b in the same level of tree_store. |
Parameters: dataColumns Types for the data to be stored in the TreeStore.
{new DataColumnBoolean(), new DataColumnString()}
to the
constructor, then the DataRow must contain a Boolean and a String object,
respectively.
Parameters: aRow a row to be added to the list
{new DataColumnBoolean(), new DataColumnString()}
to the
constructor, then the DataRow must contain a Boolean and a String object,
respectively.
Parameters: aRow
a row to be added to the list aParent
a TreeIter
pointing to a parent row.
{new DataColumnBoolean(), new DataColumnString()}
to the
constructor, then the DataRow must contain a Boolean and a String object,
respectively.
Parameters: aRow a row to be added to the list
{new DataColumnBoolean(), new DataColumnString()}
to the
constructor, then the DataRow must contain a Boolean and a String object,
respectively.
Parameters: aRow
a row to be added to the list aParent
a TreeIter
pointing to a parent row.
Parameters: parent A valid TreeIter, or NULL
Returns: Iterator for the new row.
List
with the types for every column as a
DataColumn
object.
Returns: the list of DataColumn
's
aCol
as a
DataColumn
. This is similar to calling
getType(int)
; the difference is that this method returns
the type as a DataColumn, which is a more high-level structure.
Parameters: aCol the column index
Returns: the corresponding DataColumn
Parameters: iter The iterator to test the depth of
Returns: Depth of the iterator.
aIter
. There
are several ways you can get a TreeIter
to pass; for
example: using methods like getIter
and
getFirstIter()
, or from a TreeSelection
.
Parameters: aIter the iter pointing to the row
Returns: a DataRow
filled with the values of the row.
See Also: getIter getIter getFirstIter TreeSelection
Returns: A DataColumn object representing the currently sorted column or null if there is no column currently sorted.
Returns: A SortType object defining the current sorting order of the store or null if there is no current sort order.
Parameters: parent A valid TreeIter, or NULL position Position to insert the new row
Returns: Iterator for the new row
Parameters: parent A valid TreeIter, or NULL sibling A valid GtkTreeIter, or NULL
Returns: Iterator for the new row.
Parameters: parent A valid TreeIter, or NULL sibling A valid TreeIter, or NULL
Returns: Iterator for the new row.
Parameters: iter Row to be tested. descendant Descendant row for testing
Returns: True of iter is an ancestor of descendant
Since: 2.2
Since: 2.2
Since: 2.2
Since: 2.2
Parameters: parent A valid TreeIter, or NULL
Returns: Iterator for the new row.
Parameters: iter TreeIter representing the row.
aIter
to the values stored in
aRow
.
Parameters: aRow
a row with items aIter
a TreeIter
pointing to a row in the tree.
See Also: getRowAt
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
Since: 2.8.5
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock
The datablock in which the data should be stored. iter
Valid iterator for the data row in which the value is to be
set. These can be gotten using methods such as
appendRow. value
The long
value to set into this row.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The datablock in which the data should be stored. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The data block in which to store the data, starting at 0. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set. This must match the type for that dataBlock, as set in the constructor.
This does not make the data visible in any of the widgets which use the class - to do that, you have to construct a TreeViewColumn and add it to the TreeView; construct and add a CellRenderer to that; and finally associate the properties of the CellRenderer with the dataBlocks, using the TreeViewColumn method.
Parameters: dataBlock The data block in which to store the data, starting at 0. iter Valid iterator for the data row in which the value is to be set. These can be gotten using methods such as appendRow. value The value to be set.
Since: 2.2