|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.myfaces.custom.tree.model.DefaultTreeModel
| Constructor Summary | |
DefaultTreeModel()
|
|
DefaultTreeModel(TreeNode root)
|
|
| Method Summary | |
protected void |
fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners of a node change. |
protected void |
fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners of structure change. |
protected void |
fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners of structure change. |
protected void |
fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Notify all listeners of structure change. |
protected void |
fireTreeStructureChanged(java.lang.Object source,
TreePath path)
Notify all listeners of structure change. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Return the child of parent at index index
in the parent's child array. |
int |
getChildCount(java.lang.Object parent)
Answer the number of children of parent. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Return the index of child in parent. |
TreeNode[] |
getPathToRoot(TreeNode node)
Collect all parent nodes up to the root node. |
protected TreeNode[] |
getPathToRoot(TreeNode node,
int depth)
Recursivly collect parent nodes up the the root node. |
java.lang.Object |
getRoot()
Return the root of the tree. |
java.util.Collection |
getTreeModelListeners()
Answer the mutable collection of tree model listeners. |
boolean |
isLeaf(java.lang.Object node)
Answer true if node is a leaf. |
void |
nodeChanged(TreeNode node)
Invoke this method after you've changed how node is to be represented in the tree. |
void |
nodesChanged(TreeNode node,
int[] childIndices)
Invoke this method after you've changed how the children identified by childIndicies are to be represented in the tree. |
void |
nodeStructureChanged(TreeNode node)
Invoke this method if you've totally changed the children of node and its childrens children... |
void |
nodesWereInserted(TreeNode node,
int[] childIndices)
Invoke this method after you've inserted some TreeNodes into node. |
void |
nodesWereRemoved(TreeNode node,
int[] childIndices,
java.lang.Object[] removedChildren)
Invoke this method after you've removed some TreeNodes from node. |
void |
valueForPathChanged(TreePath path,
java.lang.Object newValue)
Called when the value for the item identified by path has changed to newValue.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultTreeModel()
public DefaultTreeModel(TreeNode root)
| Method Detail |
public java.lang.Object getRoot()
TreeModel
getRoot in interface TreeModel
public java.lang.Object getChild(java.lang.Object parent,
int index)
TreeModelparent at index index
in the parent's child array.
getChild in interface TreeModelparent - a node in the tree
parent at index indexpublic int getChildCount(java.lang.Object parent)
TreeModelparent.
getChildCount in interface TreeModelparent - a node in the tree
parentpublic boolean isLeaf(java.lang.Object node)
TreeModeltrue if node is a leaf.
isLeaf in interface TreeModelnode - a node in the tree
node is a leaf
public void valueForPathChanged(TreePath path,
java.lang.Object newValue)
TreeModelpath has changed to newValue.
If newValue signifies a truly new value
the model should post a treeNodesChanged event.
valueForPathChanged in interface TreeModelpath - path to the node that has been alterednewValue - the new value from the TreeCellEditor
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
TreeModel
getIndexOfChild in interface TreeModelparent - a node in the treechild - the node we are interested in
child or parent are nullpublic java.util.Collection getTreeModelListeners()
TreeModel
getTreeModelListeners in interface TreeModelpublic void nodeChanged(TreeNode node)
public void nodesChanged(TreeNode node,
int[] childIndices)
public void nodeStructureChanged(TreeNode node)
public void nodesWereInserted(TreeNode node,
int[] childIndices)
public void nodesWereRemoved(TreeNode node,
int[] childIndices,
java.lang.Object[] removedChildren)
public TreeNode[] getPathToRoot(TreeNode node)
node - the TreeNode to get the path for
protected TreeNode[] getPathToRoot(TreeNode node,
int depth)
node - the TreeNode to get the path fordepth - number of steps already taken towards the root (on recursive calls)
protected void fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
source - the node being changedpath - the path to the root nodechildIndices - the indices of the changed elementschildren - the changed elements
protected void fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
source - the node where new elements are being insertedpath - the path to the root nodechildIndices - the indices of the new elementschildren - the new elements
protected void fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
source - the node where elements are being removedpath - the path to the root nodechildIndices - the indices of the removed elementschildren - the removed elements
protected void fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
source - the node where the tree model has changedpath - the path to the root nodechildIndices - the indices of the affected elementschildren - the affected elements
protected void fireTreeStructureChanged(java.lang.Object source,
TreePath path)
source - the node where the tree model has changedpath - the path to the root node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||