|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gnu.glib.GObject | +--org.gnu.gtk.TreeModel | +--org.gnu.gtk.ListStore
The ListStore is the gtk Model used for constructing Lists and tables to be
displayed within TreeView
widgets. For full details of what objects
are needed to construct lists and tables, please see the TreeView
description.
The list store has a number of DataBlock
s, or data 'columns' associated
with it. These do not correspond to the organisation of the output
into columns. The data store can in fact be used with any number of treeView
widgets, each displaying a different part of the data. In these Java
bindings, we will try to use the term dataBlock for the data in the ListStore
and Column to refer to the columns to be displayed. The data to be displayed
is set in the TreeViewColumn
objects, by associating properties of
CellRenderer
's with the data block used in this object.
Constructor Summary | |
ListStore(DataBlock[] dataBlocks)
Constructs a new ListStore object for storing data in a list style manner. |
Method Summary | |
TreeIter |
appendRow()
Appends a new row to the store |
void |
clear()
Removes all rows from the list store. |
static Type |
getType()
Retrieve the runtime type used by the GLib library. |
TreeIter |
insertRow(int position)
Creates a new row at position . |
TreeIter |
insertRowAfter(TreeIter sibling)
Inserts a new row after sibling. |
TreeIter |
insertRowBefore(TreeIter sibling)
Inserts a new row before sibling. |
TreeIter |
prependRow()
Prepends a new row to list_store. |
void |
removeRow(TreeIter iter)
Removes the given row from the list store. |
void |
setValue(TreeIter iter,
DataBlockBoolean dataBlock,
boolean value)
Sets a value in the data store. |
void |
setValue(TreeIter iter,
DataBlockDouble dataBlock,
double value)
Sets a value in the data store. |
void |
setValue(TreeIter iter,
DataBlockInt dataBlock,
int value)
Sets a value in the data store. |
void |
setValue(TreeIter iter,
DataBlockObject dataBlock,
java.lang.Object value)
Sets a value in the dataStore. |
void |
setValue(TreeIter iter,
DataBlockPixbuf dataBlock,
Pixbuf value)
Sets a value in the dataStore. |
void |
setValue(TreeIter iter,
DataBlockString dataBlock,
java.lang.String value)
Sets a value in the data store. |
Methods inherited from class org.gnu.gtk.TreeModel |
getDataBlockCount, getFirstChild, getFirstIter, getIter, getIter, getIterChildCount, getNextIter, getPath, getType, getValue, getValue, getValue, getValue, getValue, iterHasChild |
Methods inherited from class org.gnu.glib.GObject |
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ListStore(DataBlock[] dataBlocks)
dataBlocks
- a list of dataBlocs for the store. These should be
created as private variables of the required type - they will be needed
later.Method Detail |
public void setValue(TreeIter iter, DataBlockString dataBlock, java.lang.String value)
TreeViewColumn
.
iter
- A valid iterator which specifies the row in which the data
should be set. Iterators can be gained by using methods such as
appendRow()
.dataBlock
- The data block to store the value in.value
- The value to store. This must be of the same type
for the column as that set in the constructor to the ListStore.public void setValue(TreeIter iter, DataBlockInt dataBlock, int value)
TreeViewColumn
.
iter
- A valid iterator which specifies the row in which the data
should be set. Iterators can be gained by using methods such as
appendRow()
.dataBlock
- The data block to store the value in.value
- The value to store. This must be of the same type
for the column as that set in the constructor to the ListStore.public void setValue(TreeIter iter, DataBlockBoolean dataBlock, boolean value)
TreeViewColumn
.
iter
- A valid iterator which specifies the row in which the data
should be set. Iterators can be gained by using methods such as
appendRow()
.dataBlock
- The data block to store the value in.value
- The value to store. This must be of the same type
for the column as that set in the constructor to the ListStore.public void setValue(TreeIter iter, DataBlockDouble dataBlock, double value)
TreeViewColumn
.
iter
- A valid iterator which specifies the row in which the data
should be set. Iterators can be gained by using methods such as
appendRow()
.dataBlock
- The data block to store the value in.value
- The value to store.public void setValue(TreeIter iter, DataBlockObject dataBlock, java.lang.Object value)
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(TreeIter)
.value
- The value to be set.public void setValue(TreeIter iter, DataBlockPixbuf dataBlock, Pixbuf value)
This does not make the data visible in any of the widgets which use the class
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(TreeIter)
.value
- The value to be set. This must match the type for
that dataBlock, as set in the constructor.public void removeRow(TreeIter iter)
iter
is set to be the next valid row, or invalidated if it
pointed to the last row in this store.
iter
- Iterator for the row to be removed.public TreeIter insertRow(int position)
position
. If position is larger than the
number of rows on the list, then the new row will be appended to the list.
position
- The position to place the new row, starting at 0.
public TreeIter insertRowBefore(TreeIter sibling)
sibling
-
public TreeIter insertRowAfter(TreeIter sibling)
sibling
-
public TreeIter prependRow()
public TreeIter appendRow()
public void clear()
public static Type getType()
|
Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |