org.apache.myfaces.custom.tree.model
Class TreeModelEvent
java.lang.Object
org.apache.myfaces.custom.tree.model.TreeModelEvent
public class TreeModelEvent
extends java.lang.Object
$Revision: 169651 $ $Date: 2005-05-11 18:14:23 +0200 (Wed, 11 May 2005) $TreeModelEvent(Object source, Object[] path) - Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
TreeModelEvent(Object source, Object[] path, int[] childIndices, Object[] children) - Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
an array of Objects.
|
TreeModelEvent(Object source, TreePath path) - Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
TreeModelEvent(Object source, TreePath path, int[] childIndices, Object[] children) - Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
int[] | getChildIndices() - Returns the values of the child indexes.
|
Object[] | getChildren() - Return the objects that are children of the node identified by
the path of this event at the locations specified by
getChildIndices .
|
Object | getSource() - Answer the source of this event
|
TreePath | getTreePath() - For all events, except treeStructureChanged,
returns the parent of the changed nodes.
|
String | toString() - Returns a string that displays and identifies this object's
properties.
|
TreeModelEvent
public TreeModelEvent(Object source,
Object[] path)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
source
- the Object responsible for generating the eventpath
- an array of Object identifying the path to the parent of the modified item(s)
TreeModelEvent
public TreeModelEvent(Object source,
Object[] path,
int[] childIndices,
Object[] children)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
an array of Objects. All of the modified objects are siblings which are
direct descendents (not grandchildren) of the specified parent.
The positions at which the inserts, deletes, or changes occurred are
specified by an array of int
. The indexes in that array
must be in order, from lowest to highest.
source
- the Object responsible for generating the eventpath
- an array of Object identifying the path to the parent of the modified item(s)childIndices
- array that specifies the
index values of the removed items. The indices must be in sorted order, from lowest to highestchildren
- an array containing the inserted, removed, or changed objects
TreeModelEvent
public TreeModelEvent(Object source,
TreePath path)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
source
- the Object responsible for generating the eventpath
- a TreePath object that identifies the path to the parent of the modified item(s)
TreeModelEvent
public TreeModelEvent(Object source,
TreePath path,
int[] childIndices,
Object[] children)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
source
- the Object responsible for generating the eventpath
- a TreePath object that identifies the path to the parent of the modified item(s)childIndices
- array that specifies the index values of the modified itemschildren
- an array containing the inserted, removed, or changed objects
getChildIndices
public int[] getChildIndices()
Returns the values of the child indexes. If this is a removal event
the indexes point to locations in the initial list where items
were removed. If it is an insert, the indices point to locations
in the final list where the items were added. For node changes,
the indices point to the locations of the modified nodes.
- an array containing index locations for the children specified by the event
getChildren
public Object[] getChildren()
Return the objects that are children of the node identified by
the path of this event at the locations specified by
getChildIndices
. If this is a removal event the
returned objects are no longer children of the parent node.
- an array of Object containing the children specified by
the event
getSource
public Object getSource()
Answer the source of this event
getTreePath
public TreePath getTreePath()
For all events, except treeStructureChanged,
returns the parent of the changed nodes.
For treeStructureChanged events, returns the ancestor of the
structure that has changed. This and
getChildIndices
are used to get a list of the effected
nodes.
The one exception to this is a treeNodesChanged event that is to
identify the root, in which case this will return the root
and
getChildIndices
will return null.
- the TreePath used in identifying the changed nodes.
toString
public String toString()
Returns a string that displays and identifies this object's
properties.
- a String representation of this object