public interface TreeModel<E>
Tree
use to get the content of items.
Note: changing a render will not cause the tree to re-render.
If you want it to re-render, you could assign the same model again
(i.e., setModel(getModel())), or fire an TreeDataEvent
event.
For introduction, please refer to ZK Developer's Reference: Tree Model.
Modifier and Type | Method and Description |
---|---|
void |
addTreeDataListener(TreeDataListener l)
Add a listener to the tree that's notified each time a change to the data model occurs
|
E |
getChild(E parent,
int index)
Returns the child of the given parent at the given index where the index indicates in the parent's child array.
|
E |
getChild(int[] path)
Returns the child at the given path where the path indicates the child is
placed in the whole tree.
|
int |
getChildCount(E parent)
Returns the number of children of the given parent.
|
int |
getIndexOfChild(E parent,
E child)
Returns the index of the given child in the given parent.
|
int[] |
getPath(E child)
Returns the path from the given child, where the path indicates the child is
placed in the whole tree.
|
E |
getRoot()
Returns the root of the tree.
|
boolean |
isLeaf(E node)
Returns true if node is a leaf.
|
void |
removeTreeDataListener(TreeDataListener l)
Remove a listener to the tree that's notified each time a change to the data model occurs
|
boolean isLeaf(E node)
node
- a node in the tree, obtained from this data sourceE getChild(E parent, int index)
parent
- a node in the tree, obtained from this data sourceint getChildCount(E parent)
parent
- a node in the tree, obtained from this data sourceint getIndexOfChild(E parent, E child)
parent
- a node in the tree, obtained from this data sourcechild
- the node we are interested inE getRoot()
E getChild(int[] path)
path
- the tree pathint[] getPath(E child)
child
- the node we are interested invoid addTreeDataListener(TreeDataListener l)
l
- the listener to addvoid removeTreeDataListener(TreeDataListener l)
l
- the listener to removeCopyright © 2005-2011 Potix Corporation. All Rights Reserved.