org.zkoss.zul.event
Class TreeDataEvent

java.lang.Object
  extended by org.zkoss.zul.event.TreeDataEvent

public class TreeDataEvent
extends java.lang.Object

Defines an event that encapsulates changes to a tree.

Since:
3.0.0
Author:
Jeff Liu

Field Summary
static int CONTENTS_CHANGED
          Identifies changing contents of nodes.
static int INTERVAL_ADDED
          Identifies the addition of children to a node.
static int INTERVAL_REMOVED
          Identifies the removal of children to a node.
static int MULTIPLE_CHANGED
          Identified the state of Selectable.isMultiple() is changed.
static int OPEN_CHANGED
          Identifies the open status of the tree has changed.
static int SELECTION_CHANGED
          Identifies the selection of the tree has changed.
static int STRUCTURE_CHANGED
          Identifies the structure of the tree has changed.
 
Constructor Summary
TreeDataEvent(TreeModel model, int type, int[] nodePath, int indexFrom, int indexTo)
          Constructor.
TreeDataEvent(TreeModel model, int type, int[] nodePath, int indexFrom, int indexTo, int[] affectedPath)
          Constructor.
 
Method Summary
 int[] getAffectedPath()
          Return the path of removed node
 int getIndexFrom()
          Return the lower index of the change range
 int getIndexTo()
          Return the upper index of the change range
 TreeModel getModel()
          Returns the tree model that fires this event.
 int[] getPath()
          Returns the path of the affected node.
 int getType()
          Returns the event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENTS_CHANGED

public static final int CONTENTS_CHANGED
Identifies changing contents of nodes.

See Also:
Constant Field Values

INTERVAL_ADDED

public static final int INTERVAL_ADDED
Identifies the addition of children to a node.

See Also:
Constant Field Values

INTERVAL_REMOVED

public static final int INTERVAL_REMOVED
Identifies the removal of children to a node.

See Also:
Constant Field Values

STRUCTURE_CHANGED

public static final int STRUCTURE_CHANGED
Identifies the structure of the tree has changed. @since 5.0.6

See Also:
Constant Field Values

SELECTION_CHANGED

public static final int SELECTION_CHANGED
Identifies the selection of the tree has changed. @since 6.0.0

See Also:
Constant Field Values

OPEN_CHANGED

public static final int OPEN_CHANGED
Identifies the open status of the tree has changed. @since 6.0.0

See Also:
Constant Field Values

MULTIPLE_CHANGED

public static final int MULTIPLE_CHANGED
Identified the state of Selectable.isMultiple() is changed.

Since:
6.0.0
See Also:
Constant Field Values
Constructor Detail

TreeDataEvent

public TreeDataEvent(TreeModel model,
                     int type,
                     int[] nodePath,
                     int indexFrom,
                     int indexTo)
Constructor.

Parameters:
type - one of CONTENTS_CHANGED, INTERVAL_ADDED, INTERVAL_REMOVED, SELECTION_CHANGED, OPEN_CHANGED, STRUCTURE_CHANGED or MULTIPLE_CHANGED.
nodePath - the path of the affected node. If CONTENTS_CHANGED, INTERVAL_ADDED or INTERVAL_REMOVED, it is the parent node. If SELECTION_CHANGED or OPEN_CHANGED, it is the node being selected or opened. If STRUCTURE_CHANGED or MULTIPLE_CHANGED, it is null.
indexFrom - the lower index of the change range
indexTo - the upper index of the change range

TreeDataEvent

public TreeDataEvent(TreeModel model,
                     int type,
                     int[] nodePath,
                     int indexFrom,
                     int indexTo,
                     int[] affectedPath)
Constructor.

Parameters:
type - one of CONTENTS_CHANGED, INTERVAL_ADDED, INTERVAL_REMOVED, SELECTION_CHANGED, OPEN_CHANGED, STRUCTURE_CHANGED or MULTIPLE_CHANGED.
nodePath - the path of the affected node. If CONTENTS_CHANGED, INTERVAL_ADDED or INTERVAL_REMOVED, it is the parent node. If SELECTION_CHANGED or OPEN_CHANGED, it is the node being selected or opened. If STRUCTURE_CHANGED or MULTIPLE_CHANGED, it is null.
indexFrom - the lower index of the change range
indexTo - the upper index of the change range
affectedPath - the path to be removed or added
Method Detail

getModel

public TreeModel getModel()
Returns the tree model that fires this event.


getType

public int getType()
Returns the event type. One of CONTENTS_CHANGED, INTERVAL_ADDED, or INTERVAL_REMOVED.


getPath

public int[] getPath()
Returns the path of the affected node. If CONTENTS_CHANGED, INTERVAL_ADDED or INTERVAL_REMOVED, it is the parent node. If SELECTION_CHANGED or OPEN_CHANGED, it is the node being selected or opened. If STRUCTURE_CHANGED or MULTIPLE_CHANGED, it is null.

Returns:
the parent node that one of its children being modified

getIndexFrom

public int getIndexFrom()
Return the lower index of the change range

Returns:
the lower index of the change range

getIndexTo

public int getIndexTo()
Return the upper index of the change range

Returns:
the upper index of the change range

getAffectedPath

public int[] getAffectedPath()
Return the path of removed node

Returns:
the node that is removed


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo