VALUE - is the generic type of the value contained in each node.public class UiTreeNodeModel<VALUE> extends Object implements UiWidgetAbstractTree.UiTreeModelMutable<TreeNodeSimple<VALUE>>
mutable tree model.| Constructor and Description |
|---|
UiTreeNodeModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(TreeNodeSimple<VALUE> parent,
TreeNodeSimple<VALUE> child)
Convenience method variant of
UiWidgetAbstractTree.UiTreeModelMutable.addChild(Object, Object, int) to add a child at the end. |
void |
addChild(TreeNodeSimple<VALUE> parent,
TreeNodeSimple<VALUE> child,
int index)
Adds the given
child <NODE> to the given parent at the specified
index. |
TreeNodeSimple<VALUE> |
addChild(TreeNodeSimple<VALUE> parent,
VALUE childValue)
|
TreeNodeSimple<VALUE> |
addChild(TreeNodeSimple<VALUE> parent,
VALUE childValue,
int index)
|
List<TreeNodeSimple<VALUE>> |
getChildren(TreeNodeSimple<VALUE> node)
This method gets the children of the given tree-node.
|
void |
getChildrenAsync(TreeNodeSimple<VALUE> node,
Consumer<List<TreeNodeSimple<VALUE>>> callback)
This method gets the children of the given tree-node asynchronously.
|
void |
removeChilden(TreeNodeSimple<VALUE> parent,
TreeNodeSimple<VALUE>... children)
Removes the given
children from the parent. |
public List<TreeNodeSimple<VALUE>> getChildren(TreeNodeSimple<VALUE> node)
getChildren in interface UiWidgetAbstractTree.UiTreeModel<TreeNodeSimple<VALUE>>node - the tree-node for which the children are requested.List of child-nodes or null if NOT available and
asynchronous loading is required.public void getChildrenAsync(TreeNodeSimple<VALUE> node, Consumer<List<TreeNodeSimple<VALUE>>> callback)
getChildrenAsync in interface UiWidgetAbstractTree.UiTreeModel<TreeNodeSimple<VALUE>>node - the tree-node for which the children are requested.callback - is the Consumer that will be called when the
children are available. Maybe null if only loading shall be triggered.public void addChild(TreeNodeSimple<VALUE> parent, TreeNodeSimple<VALUE> child, int index)
child <NODE> to the given parent at the specified
index.addChild in interface UiWidgetAbstractTree.UiTreeModelMutable<TreeNodeSimple<VALUE>>parent - is the parent <NODE> where to add the given child.child - is the <NODE> to add to the children of
parent. This method will remove the child from any previous parent.
The instance of the child may later be modified. To prevent undesired modifications create a
deep-copy of the node before calling this method.index - is the index where to add the child.public void addChild(TreeNodeSimple<VALUE> parent, TreeNodeSimple<VALUE> child)
UiWidgetAbstractTree.UiTreeModelMutable.addChild(Object, Object, int) to add a child at the end.addChild in interface UiWidgetAbstractTree.UiTreeModelMutable<TreeNodeSimple<VALUE>>parent - is the parent <NODE> where to add the given child.child - is the <NODE> to add to the children of
parent.UiWidgetAbstractTree.UiTreeModelMutable.addChild(Object, Object, int)public TreeNodeSimple<VALUE> addChild(TreeNodeSimple<VALUE> parent, VALUE childValue)
public TreeNodeSimple<VALUE> addChild(TreeNodeSimple<VALUE> parent, VALUE childValue, int index)
public void removeChilden(TreeNodeSimple<VALUE> parent, TreeNodeSimple<VALUE>... children)
children from the parent.removeChilden in interface UiWidgetAbstractTree.UiTreeModelMutable<TreeNodeSimple<VALUE>>parent - is the parent <NODE> where to remove the given children.children - are the children to remove.Copyright © 2001–2016 mmm-Team. All rights reserved.