Class TreeStructureAdvisor<E>
- java.lang.Object
-
- org.eclipse.jface.databinding.viewers.TreeStructureAdvisor<E>
-
- Type Parameters:
E
- type of the elements in the tree
public abstract class TreeStructureAdvisor<E> extends Object
Instances of this class can be used to improve accuracy and performance of anObservableListTreeContentProvider
or anObservableSetTreeContentProvider
. This class is intended to be subclassed by clients.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description TreeStructureAdvisor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
getParent(E element)
Returns the parent for the given element, ornull
indicating that the parent can't be computed.Boolean
hasChildren(E element)
Returns whether the given element has children, ornull
if the actual children collection should be consulted.
-
-
-
Method Detail
-
getParent
public E getParent(E element)
Returns the parent for the given element, ornull
indicating that the parent can't be computed. In this case the tree-structured viewer can't expand a given node correctly if requested. The default implementation returns null; clients should override.- Parameters:
element
- the element- Returns:
- the parent element, or
null
if it has none or if the parent cannot be computed
-
hasChildren
public Boolean hasChildren(E element)
Returns whether the given element has children, ornull
if the actual children collection should be consulted. The default implementation returns null; clients should override.Intended as an optimization for when the viewer does not need the actual children. Clients may be able to implement this more efficiently than
getChildren
.- Parameters:
element
- the element- Returns:
Boolean.TRUE
if the given element has children,Boolean.FALSE
if the given element never has children, ornull
if the children collection should be consulted.
-
-