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

    public abstract class AbstractVirtualTreeProvider
    extends Object
    implements ITreeContentProvider

A virtual tree content provider. Allows to build a tree structure by registering tree elements using `IPath`s. When the input changes `populateElements(Object)` is called on the derived class to create the tree structure.

### Field Summary

Fields
`static IPath` `ROOT` Static root node.

### Constructor Summary

Constructors
Constructor and Description
`AbstractVirtualTreeProvider()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `dispose()`
`Object[]` `getChildren(Object parentElement)`
`Object[]` `getElements(Object inputElement)`
`Object` `getParent(Object element)`
`boolean` `hasChildren(Object element)`
`void` `inputChanged(Viewer viewer, Object oldInput, Object newInput)`
`void` `registerElement(IPath path, Object element)` Register an element contained within the tree.
`void` `registerNodeReplacement(IPath path, Object element)` Register an element that should be used instead of a dedicated path node.
`void` `registerPath(IPath path)` Register an element path to be visible on the tree.
`void` `setShowRoot(boolean showRoot)` Set to show the single root node.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ROOT

    public static final IPath ROOT

Static root node.

### Constructor Detail

#### AbstractVirtualTreeProvider

    public AbstractVirtualTreeProvider()

### Method Detail

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `IContentProvider`

#### inputChanged

    public void inputChanged(Viewer viewer,
                             Object oldInput,
                             Object newInput)

Specified by:
  `inputChanged` in interface `IContentProvider`

#### getElements

    public Object[] getElements(Object inputElement)

Specified by:
  `getElements` in interface `IStructuredContentProvider`
Specified by:
  `getElements` in interface `ITreeContentProvider`

#### getChildren

    public Object[] getChildren(Object parentElement)

Specified by:
  `getChildren` in interface `ITreeContentProvider`

#### getParent

    public Object getParent(Object element)

Specified by:
  `getParent` in interface `ITreeContentProvider`

#### hasChildren

    public boolean hasChildren(Object element)

Specified by:
  `hasChildren` in interface `ITreeContentProvider`

#### registerElement

    public void registerElement(IPath path,
                                Object element)

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

    public void registerPath(IPath path)

Register an element path to be visible on the tree.

Parameters:
  `path` - path to be visible

#### registerNodeReplacement

    public void registerNodeReplacement(IPath path,
                                        Object element)

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 use `ROOT` as 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 replaced
  `element` - replacement

#### setShowRoot

    public void setShowRoot(boolean showRoot)

Set to show the single root node. The root node is hidden by default.

Parameters:
  `showRoot` - `true` to display the root node