Class AbstractTreeRowModel<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.tree.AbstractTreeRowModel<T>
- All Implemented Interfaces:
ITreeRowModel<T>
- Direct Known Subclasses:
GlazedListTreeRowModel
,TreeRowModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollapse the tree node that represent the given object.int
depth
(int index) Expands the tree node that represents the given object.expandToLevel
(T object, int level) Expands the tree node that represents the given object to a certain level.getChildIndexes
(int parentIndex) This method returns all visible child indexes below the node at the given index.getChildren
(int parentIndex) This method returns all children below the node at the given index.getChildren
(T parent) getDirectChildIndexes
(int parentIndex) This method returns only the direct visible child indexes of the node at the given index.getDirectChildren
(int parentIndex) This method returns only the direct children of the node at the given index.getDirectChildren
(T parent) Returns theITreeData
that is backed by this tree row model.boolean
hasChildren
(int index) boolean
isCollapsed
(T object) boolean
isCollapsible
(int index) Checks if the tree node at the given index is collapsible or not.boolean
isLeaf
(int index) void
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.nebula.widgets.nattable.tree.ITreeRowModel
collapse, collapseAll, expand, expandAll, expandToLevel, expandToLevel, isCollapsed
-
Constructor Details
-
AbstractTreeRowModel
-
-
Method Details
-
registerRowGroupModelListener
-
notifyListeners
public void notifyListeners() -
depth
public int depth(int index) - Specified by:
depth
in interfaceITreeRowModel<T>
- Parameters:
index
- The index of the tree element to check.- Returns:
- The number of ancestors of the node at the specified index. Root nodes have depth 0, other nodes depth is one greater than the depth of their parent node.
-
isLeaf
public boolean isLeaf(int index) - Specified by:
isLeaf
in interfaceITreeRowModel<T>
- Parameters:
index
- The index of the tree element to check.- Returns:
true
if the tree element at the given index has no children and therefore is a leaf,false
if the tree element has children and therefore is a node.
-
hasChildren
public boolean hasChildren(int index) - Specified by:
hasChildren
in interfaceITreeRowModel<T>
- Parameters:
index
- The index of the tree element to check.- Returns:
true
if the tree element at the given index has children,false
if not.
-
isCollapsed
- Specified by:
isCollapsed
in interfaceITreeRowModel<T>
- Parameters:
object
- The element that should be checked.- Returns:
true
if the children of the given element are visible,false
if not.
-
isCollapsible
public boolean isCollapsible(int index) Checks if the tree node at the given index is collapsible or not.- Specified by:
isCollapsible
in interfaceITreeRowModel<T>
- Parameters:
index
- The index of the tree node to check.- Returns:
true
if the tree node at the given index has children,false
if not.
-
collapse
Description copied from interface:ITreeRowModel
Collapse the tree node that represent the given object.- Specified by:
collapse
in interfaceITreeRowModel<T>
- Parameters:
object
- The object that represents the tree node to collapse.- Returns:
- The indexes of all children of the collapsed tree node that become invisible by performing the collapse operation.
-
expand
Description copied from interface:ITreeRowModel
Expands the tree node that represents the given object.- Specified by:
expand
in interfaceITreeRowModel<T>
- Parameters:
object
- The object that represents the tree node to expand.- Returns:
- The indexes of all children of the expanded tree node that become visible by performing the expand operation.
-
expandToLevel
Description copied from interface:ITreeRowModel
Expands the tree node that represents the given object to a certain level.- Specified by:
expandToLevel
in interfaceITreeRowModel<T>
- Parameters:
object
- The object that represents the tree node to expand.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.
-
getChildIndexes
Description copied from interface:ITreeRowModel
This method returns all visible child indexes below the node at the given index. It search all the way down the tree structure to find every child, even the sub children, sub sub children and so on.If you only need to get the direct child indexes of the node at the given index you need to use
ITreeRowModel.getDirectChildIndexes(int)
instead.- Specified by:
getChildIndexes
in interfaceITreeRowModel<T>
- Parameters:
parentIndex
- The index for which the child indexes are requested.- Returns:
- The list of all child indexes for the node at the given index.
-
getDirectChildIndexes
Description copied from interface:ITreeRowModel
This method returns only the direct visible child indexes of the node at the given index. It does not search all the way down for further sub children.If you need to get all child indexes of the node at the given index you need to use
ITreeRowModel.getChildIndexes(int)
instead.- Specified by:
getDirectChildIndexes
in interfaceITreeRowModel<T>
- Parameters:
parentIndex
- The index for which the direct child indexes are requested.- Returns:
- The list of the direct child indexes for the node at the given index.
-
getChildren
Description copied from interface:ITreeRowModel
This method returns all children below the node at the given index. It search all the way down the tree structure to find every child, even the sub children, sub sub children and so on.If you only need to get the direct children of the node at the given index you need to use
ITreeRowModel.getDirectChildren(int)
instead.- Specified by:
getChildren
in interfaceITreeRowModel<T>
- Parameters:
parentIndex
- The index for which the children are requested.- Returns:
- The list of all children for the node at the given index.
-
getChildren
-
getDirectChildren
Description copied from interface:ITreeRowModel
This method returns only the direct children of the node at the given index. It does not search all the way down for further sub children.If you need to get all children of the node at the given index you need to use
ITreeRowModel.getChildren(int)
instead.- Specified by:
getDirectChildren
in interfaceITreeRowModel<T>
- Parameters:
parentIndex
- The index for which the direct children are requested.- Returns:
- The list of the direct children for the node at the given index.
-
getDirectChildren
-
getTreeData
Returns theITreeData
that is backed by this tree row model.- Returns:
- The
ITreeData
that is backed by this tree row model. - Since:
- 1.6
-