Class GlazedListTreeData<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.extension.glazedlists.tree.GlazedListTreeData<T>
-
-
Constructor Summary
Constructors Constructor Description GlazedListTreeData(ca.odell.glazedlists.TreeList<T> treeList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>
getChildren(int index)
Return the child objects below the object at the given index if the object is a tree node.List<T>
getChildren(T object)
Return the child objects below the given object if the object is a tree node.List<T>
getChildren(T object, boolean fullDepth)
Return the child objects below the given object if the object is a tree node.T
getDataAtIndex(int index)
int
getDepthOfData(int index)
int
getDepthOfData(T object)
int
getElementCount()
ca.odell.glazedlists.TreeList<T>
getTreeList()
boolean
hasChildren(int index)
boolean
hasChildren(T object)
int
indexOf(T object)
boolean
isValidIndex(int index)
Checks if a given index points to an element of the underlying list this ITreeData is connected to.
-
-
-
Constructor Detail
-
GlazedListTreeData
public GlazedListTreeData(ca.odell.glazedlists.TreeList<T> treeList)
-
-
Method Detail
-
getDataAtIndex
public T getDataAtIndex(int index)
- Specified by:
getDataAtIndex
in interfaceITreeData<T>
- Parameters:
index
- The index for which the corresponding object in the tree structure is requested.- Returns:
- The object at the given index in the tree structure.
-
getDepthOfData
public int getDepthOfData(T object)
- Specified by:
getDepthOfData
in interfaceITreeData<T>
- Parameters:
object
- The object that is represented by the tree node whose depth is requested.- Returns:
- the number of ancestors of the node for the given object. Root nodes have depth 0, other nodes depth is one greater than the depth of their parent node.
-
getDepthOfData
public int getDepthOfData(int index)
- Specified by:
getDepthOfData
in interfaceITreeData<T>
- Parameters:
index
- The index of the tree node whose depth is requested.- 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.
-
indexOf
public int indexOf(T object)
-
hasChildren
public boolean hasChildren(T object)
- Specified by:
hasChildren
in interfaceITreeData<T>
- Parameters:
object
- The object which should be checked for children.- Returns:
true
if the object has children in the tree structure,false
if it is a leaf.
-
hasChildren
public boolean hasChildren(int index)
- Specified by:
hasChildren
in interfaceITreeData<T>
- Parameters:
index
- The index of the object in the tree structure which should be checked for children.- Returns:
true
if the object has children in the tree structure,false
if it is a leaf.
-
getChildren
public List<T> getChildren(T object)
Description copied from interface:ITreeData
Return the child objects below the given object if the object is a tree node. It will only return the direct children and will not search for sub children.- Specified by:
getChildren
in interfaceITreeData<T>
- Parameters:
object
- The object whose children are requested.- Returns:
- The children of the given object.
-
getChildren
public List<T> getChildren(T object, boolean fullDepth)
Description copied from interface:ITreeData
Return the child objects below the given object if the object is a tree node.- Specified by:
getChildren
in interfaceITreeData<T>
- Parameters:
object
- The object whose children are requested.fullDepth
- to return only direct children or search for sub children- Returns:
- The children of the given object.
-
getChildren
public List<T> getChildren(int index)
Description copied from interface:ITreeData
Return the child objects below the object at the given index if the object is a tree node. It will only return the direct children and will not search for sub children.- Specified by:
getChildren
in interfaceITreeData<T>
- Parameters:
index
- The index of the object whose children are requested.- Returns:
- The children of the object at the given index.
-
getElementCount
public int getElementCount()
- Specified by:
getElementCount
in interfaceITreeData<T>
- Returns:
- The number of elements handled by this ITreeData.
-
isValidIndex
public boolean isValidIndex(int index)
Description copied from interface:ITreeData
Checks if a given index points to an element of the underlying list this ITreeData is connected to. This check is necessary for example to support mixing in a summary row together with a tree, where the summary row index is not in scope of the underlying list.- Specified by:
isValidIndex
in interfaceITreeData<T>
- Parameters:
index
- The index to check.- Returns:
true
if the index points to an element of the underlying list,false
if it doesn't.
-
getTreeList
public ca.odell.glazedlists.TreeList<T> getTreeList()
- Returns:
- The underlying
TreeList
thisGlazedListTreeData
is operating on.
-
-