Package com._1c.g5.v8.dt.ui.dialog
Class CheckableTreeItem
java.lang.Object
com._1c.g5.v8.dt.ui.dialog.CheckableTreeItem
Class for representing tree item, that supports checkable state.
Each tree item (or node) of a tree can be checkable or not.
Since CheckboxTreeViewer does not support to hide checkboxes on some items, this additional tree structure has been created.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCheckableTreeItem
(boolean checkable) Initializes new checkable tree item instance, using checkable input parameter.CheckableTreeItem
(boolean checkable, boolean allowChildMultiSelect) Initializes new checkable tree item instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(CheckableTreeItem childItem) Adds new child to current tree itemboolean
Determines whether multiple child elements can be selected.getValue()
boolean
Checks whether current object has childrenboolean
boolean
Returns current state of the elementvoid
setChecked
(boolean isChecked) Changes checked state of current elementvoid
Changes checked state of current elementvoid
setParent
(CheckableTreeItem parent) Sets parent of current object, can be nullvoid
-
Constructor Details
-
CheckableTreeItem
public CheckableTreeItem(boolean checkable) Initializes new checkable tree item instance, using checkable input parameter. Also allows child multi selection.- Parameters:
checkable
- - determines, whether current item can be checked or not.
-
CheckableTreeItem
public CheckableTreeItem(boolean checkable, boolean allowChildMultiSelect) Initializes new checkable tree item instance.- Parameters:
checkable
- - determines, whether current item can be checked or not.allowChildMultiSelect
- - determines, whether it is allowed to select multiple items from children of current item
-
-
Method Details
-
getParent
- Returns:
- the parent of current object, can be null
-
setParent
Sets parent of current object, can be null- Parameters:
parent
- - the parent to set
-
getChildren
- Returns:
- children of current object
-
addChild
Adds new child to current tree item- Parameters:
childItem
-
-
getValue
- Returns:
- model object
-
setValue
- Parameters:
value
- - model object to set
-
hasChildren
public boolean hasChildren()Checks whether current object has children- Returns:
- true if current object has children, false otherwise
-
isChecked
public boolean isChecked()Returns current state of the element- Returns:
- true if item is checked, false otherwise
-
setChecked
public void setChecked(boolean isChecked) Changes checked state of current element- Parameters:
true
- if item is checked, false otherwise
-
setOppositeCheckedState
public void setOppositeCheckedState()Changes checked state of current element- Parameters:
true
- if item is checked, false otherwise
-
isCheckable
public boolean isCheckable()- Returns:
- true if current item can be checkable, false otherwise
-
allowChildMultiSelection
public boolean allowChildMultiSelection()Determines whether multiple child elements can be selected.- Returns:
- true if multiple child elements can be selected, false otherwise
-