Package org.zkoss.zul.event
Class TreeDataEvent
- java.lang.Object
-
- org.zkoss.zul.event.TreeDataEvent
-
public class TreeDataEvent extends java.lang.ObjectDefines an event that encapsulates changes to a tree.- Since:
- 3.0.0
- Author:
- Jeff Liu
-
-
Field Summary
Fields Modifier and Type Field Description static intCONTENTS_CHANGEDIdentifies changing contents of nodes.static intDISABLE_CLIENT_UPDATEIdentified the state that Component's client update to be disabledstatic intENABLE_CLIENT_UPDATEIdentified the state that Component's client update to be enabledstatic intINTERVAL_ADDEDIdentifies the addition of children to a node.static intINTERVAL_REMOVEDIdentifies the removal of children to a node.static intMULTIPLE_CHANGEDIdentified the state ofSelectable.isMultiple()is changed.static intOPEN_CHANGEDIdentifies the open status of the tree has changed.static intSELECTION_CHANGEDIdentifies the selection of the tree has changed.static intSTRUCTURE_CHANGEDIdentifies the structure of the tree has changed.static intTRISTATE_CHANGEDIdentified 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.intgetIndexFrom()Return the lower index of the change rangeintgetIndexTo()Return the upper index of the change rangeTreeModelgetModel()Returns the tree model that fires this event.int[]getPath()Returns the path of the affected node.intgetType()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_CHANGEDorMULTIPLE_CHANGED.nodePath- the path of the affected node. IfCONTENTS_CHANGED,INTERVAL_ADDEDorINTERVAL_REMOVED, it is the parent node. IfSELECTION_CHANGEDorOPEN_CHANGED, it is the node being selected or opened. IfSTRUCTURE_CHANGEDorMULTIPLE_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_CHANGEDorMULTIPLE_CHANGED.nodePath- the path of the affected node. IfCONTENTS_CHANGED,INTERVAL_ADDEDorINTERVAL_REMOVED, it is the parent node. IfSELECTION_CHANGEDorOPEN_CHANGED, it is the node being selected or opened. IfSTRUCTURE_CHANGEDorMULTIPLE_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_CHANGEDorMULTIPLE_CHANGED.nodePath- the path of the affected node. IfCONTENTS_CHANGED,INTERVAL_ADDEDorINTERVAL_REMOVED, it is the parent node. IfSELECTION_CHANGEDorOPEN_CHANGED, it is the node being selected or opened. IfSTRUCTURE_CHANGEDorMULTIPLE_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_ADDEDorINTERVAL_REMOVED, it is the parent node. IfSELECTION_CHANGEDorOPEN_CHANGED, it is the node being selected or opened. IfSTRUCTURE_CHANGEDorMULTIPLE_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
-
-