Interface ITreeRowModel<T>
 Type Parameters:
T
 The type of the elements in the tree
 All Known Implementing Classes:
AbstractTreeRowModel
,GlazedListTreeRowModel
,TreeRowModel
public interface ITreeRowModel<T>
The
ITreeRowModel
is used by the TreeLayer
to build up and
interact with the tree model. It deals with the nodes and the corresponding
expand/collapse states.
Method Summary
Modifier and TypeMethodDescriptioncollapse
(int parentIndex) Collapses the tree node at the given index.Collapse the tree node that represent the given object.Collapses all tree nodes.int
depth
(int index) expand
(int parentIndex) Expands the tree node at the given index.Expands the tree node that represents the given object.Expands all tree nodes.expandToLevel
(int level) Expands all tree nodes to a certain level.expandToLevel
(int parentIndex, int level) Expands the tree node at the given index to a certain level.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.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.boolean
hasChildren
(int index) boolean
isCollapsed
(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)

Method Details

depth
int depth(int index)  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
boolean isLeaf(int index)  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
boolean hasChildren(int index)  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
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.

isCollapsed
 Parameters:
object
 The element that should be checked. Returns:
true
if the children of the given element are visible,false
if not.

isCollapsible
boolean isCollapsible(int index) Checks if the tree node at the given index is collapsible or not. Parameters:
index
 The index of the tree node to check. Returns:
true
if the tree node at the given index is collapsible,false
if not.

collapse
Collapses the tree node at the given index. Parameters:
parentIndex
 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.

collapse
Collapse the tree node that represent the given object. 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.

collapseAll
Collapses all tree nodes. Returns:
 The indexes of all children that are hidden after the collapse operation is performed.

expand
Expands the tree node at the given index. Parameters:
parentIndex
 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.

expandToLevel
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.

expand
Expands the tree node that represents the given object. 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
Expands the tree node that represents the given object to a certain level. 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.

expandAll
Expands all tree nodes. Returns:
 The indexes of all children that are showed after the expand operation is performed.

expandToLevel
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.

getChildIndexes
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
getDirectChildIndexes(int)
instead. 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
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
getChildIndexes(int)
instead. 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
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
getDirectChildren(int)
instead. Parameters:
parentIndex
 The index for which the children are requested. Returns:
 The list of all children for the node at the given index.

getDirectChildren
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
getChildren(int)
instead. 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.
