Package org.eclipse.ease.ui.tools
Class AbstractVirtualTreeProvider
java.lang.Object
org.eclipse.ease.ui.tools.AbstractVirtualTreeProvider
- All Implemented Interfaces:
IContentProvider,IStructuredContentProvider,ITreeContentProvider
- Direct Known Subclasses:
ModulesContentProvider,ModulesContentProvider,ScriptContentProvider
A virtual tree content provider. Allows to build a tree structure by registering tree elements using
IPaths. When the input changes
populateElements(Object) is called on the derived class to create the tree structure.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Object[]getChildren(Object parentElement) Object[]getElements(Object inputElement) booleanhasChildren(Object element) voidinputChanged(Viewer viewer, Object oldInput, Object newInput) voidregisterElement(IPath path, Object element) Register an element contained within the tree.voidregisterNodeReplacement(IPath path, Object element) Register an element that should be used instead of a dedicated path node.voidregisterPath(IPath path) Register an element path to be visible on the tree.voidsetShowRoot(boolean showRoot) Set to show the single root node.
-
Field Details
-
ROOT
Static root node.
-
-
Constructor Details
-
AbstractVirtualTreeProvider
public AbstractVirtualTreeProvider()
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfaceIContentProvider
-
inputChanged
- Specified by:
inputChangedin interfaceIContentProvider
-
getElements
- Specified by:
getElementsin interfaceIStructuredContentProvider- Specified by:
getElementsin interfaceITreeContentProvider
-
getChildren
- Specified by:
getChildrenin interfaceITreeContentProvider
-
getParent
- Specified by:
getParentin interfaceITreeContentProvider
-
hasChildren
- Specified by:
hasChildrenin interfaceITreeContentProvider
-
registerElement
Register an element contained within the tree. To register an element 'myFoo' under the entry '/my/element/is/myFoo' use '/my/element/is' as path. The LabelProvider needs to take care of the rendering of the element itself.- Parameters:
path- full path to be used to display this element (excluding element entry)element- element to be stored within path
-
registerPath
Register an element path to be visible on the tree.- Parameters:
path- path to be visible
-
registerNodeReplacement
Register an element that should be used instead of a dedicated path node. Allows to display a dedicated object instead of a path. To replace the root element useROOTas path. Do not replace multiple nodes with the same object (regarding its equals() method) as the tree cannot handle such structures.- Parameters:
path- path to be replacedelement- replacement
-
setShowRoot
public void setShowRoot(boolean showRoot) Set to show the single root node. The root node is hidden by default.- Parameters:
showRoot-trueto display the root node
-