|
||||||||||
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 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. |
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 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,
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 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 Object getRoot()
TreeModel
getRoot
in interface TreeModel
public Object getChild(Object parent, int index)
TreeModel
parent
at index index
in the parent's child array.
getChild
in interface TreeModel
parent
- a node in the tree
parent
at index index
public int getChildCount(Object parent)
TreeModel
parent
.
getChildCount
in interface TreeModel
parent
- a node in the tree
parent
public boolean isLeaf(Object node)
TreeModel
true
if node
is a leaf.
isLeaf
in interface TreeModel
node
- a node in the tree
node
is a leafpublic void valueForPathChanged(TreePath path, Object newValue)
TreeModel
path
has changed to newValue
.
If newValue
signifies a truly new value
the model should post a treeNodesChanged
event.
valueForPathChanged
in interface TreeModel
path
- path to the node that has been alterednewValue
- the new value from the TreeCellEditorpublic int getIndexOfChild(Object parent, Object child)
TreeModel
getIndexOfChild
in interface TreeModel
parent
- a node in the treechild
- the node we are interested in
child
or parent
are null
public Collection getTreeModelListeners()
TreeModel
getTreeModelListeners
in interface TreeModel
public 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 forprotected 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 elementsprotected 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 elementsprotected 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 elementsprotected 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 elementsprotected 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 |