public class TreeNodeContentProvider extends Object implements ITreeContentProvider
A content provider that expects every element to be a
TreeNode. Most methods delegate to
inputChanged(Viewer, Object, Object)do nothing by default.
This class and all of its methods may be overridden or extended.
- See Also:
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getChildren(Object parentElement)Returns the child elements of the given parent element.
getElements(Object inputElement)Returns the elements to display in the viewer when its input is set to the given element.
getParent(Object element)Returns the parent for the given element, or
nullindicating that the parent can't be computed.
hasChildren(Object element)Returns whether the given element has children.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildrenReturns the child elements of the given parent element.
The difference between this method andThe result is not modified by the viewer.
getElementsis called to obtain the tree viewer's root elements, whereas
getChildrenis used to obtain the children of a given parent element in the tree (including a root).
getElementsReturns the elements to display in the viewer when its input is set to the given element. These elements can be presented as rows in a table, items in a list, etc. The result is not modified by the viewer.
getParentReturns the parent for the given element, or
nullindicating that the parent can't be computed. In this case the tree-structured viewer can't expand a given node correctly if requested.
public boolean hasChildren(Object element)Returns whether the given element has children.
Intended as an optimization for when the viewer does not need the actual children. Clients may be able to implement this more efficiently than