org.apache.myfaces.custom.tree.model
Interface TreeModel
- DefaultTreeModel
public interface TreeModel
$Revision: 209487 $ $Date: 2005-07-06 19:49:15 +0200 (Wed, 06 Jul 2005) $ Object | getChild(Object parent, int index) - Return the child of
parent at index index
in the parent's child array.
|
int | getChildCount(Object parent) - Answer the number of children of
parent .
|
int | getIndexOfChild(Object parent, Object child) - Return the index of child in parent.
|
Object | getRoot() - Return the root of the tree.
|
Collection | getTreeModelListeners() - Answer the mutable collection of tree model listeners.
|
boolean | isLeaf(Object node) - Answer
true if node is a leaf.
|
void | valueForPathChanged(TreePath path, Object newValue) - Called when the value for the item identified
by
path has changed to newValue .
|
getChild
public Object getChild(Object parent,
int index)
Return the child of parent
at index index
in the parent's child array.
parent
- a node in the tree
- the child of
parent
at index index
getChildCount
public int getChildCount(Object parent)
Answer the number of children of parent
.
parent
- a node in the tree
- the number of children of the node
parent
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
Return the index of child in parent.
parent
- a node in the treechild
- the node we are interested in
- the index of the child in the parent, or -1 if either
child
or parent
are null
getRoot
public Object getRoot()
Return the root of the tree.
- the root of the tree or null, it this tree has no nodes
getTreeModelListeners
public Collection getTreeModelListeners()
Answer the mutable collection of tree model listeners.
isLeaf
public boolean isLeaf(Object node)
Answer true
if node
is a leaf.
node
- a node in the tree
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
Called when the value for the item identified
by path
has changed to newValue
.
If newValue
signifies a truly new value
the model should post a treeNodesChanged
event.
path
- path to the node that has been alterednewValue
- the new value from the TreeCellEditor