org.zkoss.zul.event
Class TreeDataEvent<E>

java.lang.Object
  extended by org.zkoss.zul.event.TreeDataEvent<E>

public class TreeDataEvent<E>
extends 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 STRUCTURE_CHANGED
          Identifies the structure of the tree has changed.
 
Constructor Summary
TreeDataEvent(TreeModel<E> model, int type, E parent, int indexFrom, int indexTo)
          Contructor.
 
Method Summary
 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.
 E getParent()
          Returns the parent node that one of its children being modified
 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
Constructor Detail

TreeDataEvent

public TreeDataEvent(TreeModel<E> model,
                     int type,
                     E parent,
                     int indexFrom,
                     int indexTo)
Contructor.

Parameters:
type - one of CONTENTS_CHANGED, INTERVAL_ADDED, or INTERVAL_REMOVED.
parent - - the parent node that its children being modified .
indexFrom - the lower index of the change range
indexTo - the upper index of the change range
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.


getParent

public E getParent()
Returns the parent node that one of its children being modified

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


Copyright © 2011. All Rights Reserved.