| org.zkoss.zul.TreeModel
All known Subclasses: org.zkoss.zul.AbstractTreeModel,
TreeModel | public interface TreeModel (Code) | | This interface defines the methods that component like
Tree use to get the content of items.
author: Jeff Liu since: ZK 3.0.0 |
addTreeDataListener | public void addTreeDataListener(TreeDataListener l)(Code) | | Add a listener to the tree that's notified each time a change to the data model occurs
Parameters: l - the listener to add |
getChild | public Object getChild(Object parent, int index)(Code) | | Returns the child of parent at index index in the parent's child array.
Parameters: parent - a node in the tree, obtained from this data source the child of parent at index index |
getChildCount | public int getChildCount(Object parent)(Code) | | Returns the number of children of parent.
Parameters: parent - a node in the tree, obtained from this data source the number of children of the node parent |
getPath | public int[] getPath(Object parent, Object lastNode)(Code) | | Returns an integer array to represent the path from parent(exclusive) to lastNode(inclusive).
notice:
The path has to be in "parent" to "lastNode" order
Ex: {1,0,2}
1. Go to the parent's child at index(1);
2. Go to the index(1)'s child at index(0);
3. Go to the index(0)'s child at idnex(2) -- the lastNode;
If parent is the same as lastNode, return null or empty array.
Parameters: parent - the origin of Path Parameters: lastNode - the destination of Path an integer array to represent the path from parent to lastNode. |
getRoot | public Object getRoot()(Code) | | Returns the root of the tree.
the root of Tree. |
isLeaf | public boolean isLeaf(Object node)(Code) | | Returns true if node is a leaf.
Parameters: node - a node in the tree, obtained from this data source true if node is a leafs |
removeTreeDataListener | public void removeTreeDataListener(TreeDataListener l)(Code) | | Remove a listener to the tree that's notified each time a change to the data model occurs
Parameters: l - the listener to remove |
|
|