Class TreeRowModel<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.tree.AbstractTreeRowModel<T>
-
- org.eclipse.nebula.widgets.nattable.tree.TreeRowModel<T>
-
- Type Parameters:
T
- The type of the elements in the tree
- All Implemented Interfaces:
ITreeRowModel<T>
public class TreeRowModel<T> extends AbstractTreeRowModel<T>
Implementation ofITreeRowModel
that is used to perform expand/collapse operations using the approach of hiding and showing rows.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<Integer>
parentIndexes
-
Constructor Summary
Constructors Constructor Description TreeRowModel(ITreeData<T> treeData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>
collapse(int index)
Collapses the tree node at the given index.List<Integer>
collapseAll()
Collapses all tree nodes.List<Integer>
expand(int index)
Expands the tree node at the given index.List<Integer>
expandAll()
Expands all tree nodes.List<Integer>
expandToLevel(int level)
Expands all tree nodes to a certain level.List<Integer>
expandToLevel(int parentIndex, int level)
Expands the tree node at the given index to a certain level.protected Collection<Integer>
internalCollapse(int index)
Performs the collapse operation without notifying the listeners while processing.protected Collection<Integer>
internalExpand(int index)
Performs the expand operations iteratively without notifying the listeners while processing.protected Collection<Integer>
internalExpandToLevel(int index, int level)
Performs the expand operations iteratively without notifying the listeners while processing.boolean
isCollapsed(int index)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.tree.AbstractTreeRowModel
collapse, depth, expand, expandToLevel, getChildIndexes, getChildren, getChildren, getDirectChildIndexes, getDirectChildren, getDirectChildren, getTreeData, hasChildren, isCollapsed, isCollapsible, isLeaf, notifyListeners, registerRowGroupModelListener
-
-
-
-
Method Detail
-
isCollapsed
public boolean isCollapsed(int index)
- Parameters:
index
- The index of the tree element to check.- Returns:
true
if the children of the tree node at the given index are visible,false
if not.
-
collapse
public List<Integer> collapse(int index)
Description copied from interface:ITreeRowModel
Collapses the tree node at the given index.- Parameters:
index
- The index of the node in the collection that should be collapsed.- Returns:
- The indexes of all children of the collapsed tree node that become invisible by performing the collapse operation.
-
internalCollapse
protected Collection<Integer> internalCollapse(int index)
Performs the collapse operation without notifying the listeners while processing.- Parameters:
index
- The index of the node in the collection that should be collapsed.- Returns:
- The indexes of all children of the collapsed tree node that become invisible by performing the collapse operation.
-
collapseAll
public List<Integer> collapseAll()
Description copied from interface:ITreeRowModel
Collapses all tree nodes.- Returns:
- The indexes of all children that are hidden after the collapse operation is performed.
-
expand
public List<Integer> expand(int index)
Description copied from interface:ITreeRowModel
Expands the tree node at the given index.- Parameters:
index
- The index of the node in the collection that should be expanded.- Returns:
- The indexes of all children of the expanded tree node that become visible by performing the expand operation.
-
internalExpand
protected Collection<Integer> internalExpand(int index)
Performs the expand operations iteratively without notifying the listeners while processing.- Parameters:
index
- The index of the node in the collection that should be expanded.- Returns:
- The indexes of all children of the expanded tree node that become visible by performing the expand operation.
-
expandAll
public List<Integer> expandAll()
Description copied from interface:ITreeRowModel
Expands all tree nodes.- Returns:
- The indexes of all children that are showed after the expand operation is performed.
-
expandToLevel
public List<Integer> expandToLevel(int level)
Description copied from interface:ITreeRowModel
Expands all tree nodes to a certain level.- Parameters:
level
- The level to which the tree nodes should be expanded.- Returns:
- The indexes of all children that are showed after the expand operation is performed.
-
expandToLevel
public List<Integer> expandToLevel(int parentIndex, int level)
Description copied from interface:ITreeRowModel
Expands the tree node at the given index to a certain level.- Parameters:
parentIndex
- The index of the node in the collection that should be expanded.level
- The level to which the tree node should be expanded.- Returns:
- The indexes of all children that are showed after the expand operation is performed.
-
internalExpandToLevel
protected Collection<Integer> internalExpandToLevel(int index, int level)
Performs the expand operations iteratively without notifying the listeners while processing.- Parameters:
index
- The index of the node in the collection that should be expanded.level
- The level to which the tree nodes should be expanded.- Returns:
- The indexes of all children of the expanded tree node that become visible by performing the expand operation.
-
-