| 
 | ||||||||||
| 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
public class DefaultTreeModel
| Constructor Summary | |
|---|---|
| DefaultTreeModel() | |
| DefaultTreeModel(TreeNode root) | |
| Method Summary | |
|---|---|
| protected  void | fireTreeNodesChanged(Object source,
                     Object[] path,
                     int[] childIndices,
                     Object[] children)Notify all listeners of a node change. | 
| protected  void | fireTreeNodesInserted(Object source,
                      Object[] path,
                      int[] childIndices,
                      Object[] children)Notify all listeners of structure change. | 
| protected  void | fireTreeNodesRemoved(Object source,
                     Object[] path,
                     int[] childIndices,
                     Object[] children)Notify all listeners of structure change. | 
| protected  void | fireTreeStructureChanged(Object source,
                         Object[] path,
                         int[] childIndices,
                         Object[] children)Notify all listeners of structure change. | 
| protected  void | fireTreeStructureChanged(Object source,
                         TreePath path)Notify all listeners of structure change. | 
|  Object | getChild(Object parent,
         int index)Return the child of parentat indexindexin 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. | 
|  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. | 
|  Object | getRoot()Return the root of the tree. | 
|  Collection | getTreeModelListeners()Answer the mutable collection of tree model listeners. | 
|  boolean | isLeaf(Object node)Answer trueifnodeis 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,
                 Object[] removedChildren)Invoke this method after you've removed some TreeNodes from node. | 
|  void | valueForPathChanged(TreePath path,
                    Object newValue)Called when the value for the item identified by pathhas changed tonewValue. | 
| 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 Object getRoot()
TreeModel
getRoot in interface TreeModel
public Object getChild(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(Object parent)
TreeModelparent.
getChildCount in interface TreeModelparent - a node in the tree
parentpublic boolean isLeaf(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,
                                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(Object parent,
                           Object child)
TreeModel
getIndexOfChild in interface TreeModelparent - a node in the treechild - the node we are interested in
child or parent are nullpublic 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,
                             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(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    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(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     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(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    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(Object source,
                                        Object[] path,
                                        int[] childIndices,
                                        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(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 | |||||||||