Package org.zkoss.zul.event
Class TreeDataEvent
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description static int
CONTENTS_CHANGED
Identifies changing contents of nodes.static int
DISABLE_CLIENT_UPDATE
Identified the state that Component's client update to be disabledstatic int
ENABLE_CLIENT_UPDATE
Identified the state that Component's client update to be enabledstatic 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 ofSelectable.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.static int
TRISTATE_CHANGED
Identified the state of partial selection in a tristate checkbox is changed.
-
Constructor Summary
Constructors Constructor Description 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.TreeDataEvent(TreeModel model, int type, int[] nodePath, int indexFrom, int indexTo, int[][] affectedPaths)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getAffectedPath()
Return the path of removed nodeint[][]
getAffectedPaths()
Return the paths of removed nodes, if any.int
getIndexFrom()
Return the lower index of the change rangeint
getIndexTo()
Return the upper index of the change rangeTreeModel
getModel()
Returns the tree model that fires this event.int[]
getPath()
Returns the path of the affected node.int
getType()
Returns the event type.
-
-
-
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 ofSelectable.isMultiple()
is changed.- Since:
- 6.0.0
- See Also:
- Constant Field Values
-
TRISTATE_CHANGED
public static final int TRISTATE_CHANGED
Identified the state of partial selection in a tristate checkbox is changed.- Since:
- 10.0.0
- See Also:
- Constant Field Values
-
DISABLE_CLIENT_UPDATE
public static final int DISABLE_CLIENT_UPDATE
Identified the state that Component's client update to be disabled- Since:
- 8.0.0
- See Also:
- Constant Field Values
-
ENABLE_CLIENT_UPDATE
public static final int ENABLE_CLIENT_UPDATE
Identified the state that Component's client update to be enabled- Since:
- 8.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 ofCONTENTS_CHANGED
,INTERVAL_ADDED
,INTERVAL_REMOVED
,SELECTION_CHANGED
,OPEN_CHANGED
,STRUCTURE_CHANGED
orMULTIPLE_CHANGED
.nodePath
- the path of the affected node. IfCONTENTS_CHANGED
,INTERVAL_ADDED
orINTERVAL_REMOVED
, it is the parent node. IfSELECTION_CHANGED
orOPEN_CHANGED
, it is the node being selected or opened. IfSTRUCTURE_CHANGED
orMULTIPLE_CHANGED
, it is null.indexFrom
- the lower index of the change rangeindexTo
- 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 ofCONTENTS_CHANGED
,INTERVAL_ADDED
,INTERVAL_REMOVED
,SELECTION_CHANGED
,OPEN_CHANGED
,STRUCTURE_CHANGED
orMULTIPLE_CHANGED
.nodePath
- the path of the affected node. IfCONTENTS_CHANGED
,INTERVAL_ADDED
orINTERVAL_REMOVED
, it is the parent node. IfSELECTION_CHANGED
orOPEN_CHANGED
, it is the node being selected or opened. IfSTRUCTURE_CHANGED
orMULTIPLE_CHANGED
, it is null.indexFrom
- the lower index of the change rangeindexTo
- the upper index of the change rangeaffectedPath
- the path to be removed or added
-
TreeDataEvent
public TreeDataEvent(TreeModel model, int type, int[] nodePath, int indexFrom, int indexTo, int[][] affectedPaths)
Constructor.- Parameters:
type
- one ofCONTENTS_CHANGED
,INTERVAL_ADDED
,INTERVAL_REMOVED
,SELECTION_CHANGED
,OPEN_CHANGED
,STRUCTURE_CHANGED
orMULTIPLE_CHANGED
.nodePath
- the path of the affected node. IfCONTENTS_CHANGED
,INTERVAL_ADDED
orINTERVAL_REMOVED
, it is the parent node. IfSELECTION_CHANGED
orOPEN_CHANGED
, it is the node being selected or opened. IfSTRUCTURE_CHANGED
orMULTIPLE_CHANGED
, it is null.indexFrom
- the lower index of the change rangeindexTo
- the upper index of the change rangeaffectedPaths
- the paths to be removed or added- Since:
- 10.0.0
-
-
Method Detail
-
getModel
public TreeModel getModel()
Returns the tree model that fires this event.
-
getType
public int getType()
-
getPath
public int[] getPath()
Returns the path of the affected node. IfCONTENTS_CHANGED
,INTERVAL_ADDED
orINTERVAL_REMOVED
, it is the parent node. IfSELECTION_CHANGED
orOPEN_CHANGED
, it is the node being selected or opened. IfSTRUCTURE_CHANGED
orMULTIPLE_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
-
getAffectedPaths
public int[][] getAffectedPaths()
Return the paths of removed nodes, if any.- Since:
- 10.0.0
-
-