public final class TreePath extends Boxed
Paths in ListStores are quite simple. They are a simple number,
incrementing from zero, indicating the row number. For example,
TreePath("8")
is the ninth row in the model.
Paths for TreeStores are more complex. They are of the form
"first:second:third:..." where each of first, second, and third denote the
number of steps in from the first at each level of the hierarchy. For
example, TreePath("2:4:0")
represents the first third level
element in the fifth second level element in the third row.
TreePaths are given to you as a row address in signals like
TreeView.RowActivated
. Usually you need the row expressed as a
TreeIter (ie to get a value out of the row);to do that call the underlying
TreeModel's getIter()
method.
Constructor and Description |
---|
TreePath(String path)
Create a TreePath object from the String form.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Return
true of this TreePath represents the same logical
path as the other does. |
int |
getDepth()
Returns the depth of node identified by this TreePath within the tree.
|
int[] |
getIndices()
Returns the indices the path consists of as an array of integer.
|
String |
toString()
Return the text form represented by this TreePath.
|
public TreePath(String path)
getIter()
method.IllegalArgumentException
- if the path
fails to parse as a valid
TreePath.public boolean equals(Object other)
true
of this TreePath represents the same logical
path as the other
does.equals
in class Object
public int getDepth()
public int[] getIndices()
null
if nothing is
selected.public String toString()
toString
in class org.freedesktop.bindings.Pointer