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.intdepth(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 theITreeDatathat is backed by this tree row model.booleanhasChildren(int index) booleanisCollapsed(T object) booleanisCollapsible(int index) Checks if the tree node at the given index is collapsible or not.booleanisLeaf(int index) voidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
depthin 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:
isLeafin interfaceITreeRowModel<T>- Parameters:
index- The index of the tree element to check.- Returns:
trueif the tree element at the given index has no children and therefore is a leaf,falseif the tree element has children and therefore is a node.
-
hasChildren
public boolean hasChildren(int index) - Specified by:
hasChildrenin interfaceITreeRowModel<T>- Parameters:
index- The index of the tree element to check.- Returns:
trueif the tree element at the given index has children,falseif not.
-
isCollapsed
- Specified by:
isCollapsedin interfaceITreeRowModel<T>- Parameters:
object- The element that should be checked.- Returns:
trueif the children of the given element are visible,falseif not.
-
isCollapsible
public boolean isCollapsible(int index) Checks if the tree node at the given index is collapsible or not.- Specified by:
isCollapsiblein interfaceITreeRowModel<T>- Parameters:
index- The index of the tree node to check.- Returns:
trueif the tree node at the given index has children,falseif not.
-
collapse
Description copied from interface:ITreeRowModelCollapse the tree node that represent the given object.- Specified by:
collapsein 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:ITreeRowModelExpands the tree node that represents the given object.- Specified by:
expandin 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:ITreeRowModelExpands the tree node that represents the given object to a certain level.- Specified by:
expandToLevelin 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:ITreeRowModelThis 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:
getChildIndexesin 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:ITreeRowModelThis 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:
getDirectChildIndexesin 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:ITreeRowModelThis 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:
getChildrenin 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:ITreeRowModelThis 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:
getDirectChildrenin 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 theITreeDatathat is backed by this tree row model.- Returns:
- The
ITreeDatathat is backed by this tree row model. - Since:
- 1.6
-