Class FlatteningTreeContentProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.navigator.providers.FlatteningTreeContentProvider
-
- All Implemented Interfaces:
IContentProvider
,IStructuredContentProvider
,ITreeContentProvider
public class FlatteningTreeContentProvider extends Object implements ITreeContentProvider
The tree content provider that flattens the given node classes of the source tree content provider. For example, given the tree path a -> b -> c and the instruction to flatten nodes of class b, the node path will be transformed to a -> c. More practical example, you haveNavigatorContentProvider
on hands but you want to show only the contents of Catalogs node attached directly to the top-level project nodes. To achieve this, you need to instruct theFlatteningTreeContentProvider
to flatten theCatalogNavigatorAdapter.Folder
node and setup the tree viewer filter to show onlyIWorkspaceRoot
,IProject
andCatalog
nodes.
-
-
Constructor Summary
Constructors Constructor Description FlatteningTreeContentProvider(ITreeContentProvider sourceProvider, Class<?>... nodesToFlatten)
Instantiates a new flattening tree content provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Constructor Detail
-
FlatteningTreeContentProvider
public FlatteningTreeContentProvider(ITreeContentProvider sourceProvider, Class<?>... nodesToFlatten)
Instantiates a new flattening tree content provider.- Parameters:
sourceProvider
- the source providernodesToFlatten
- the nodes to flatten
-
-
Method Detail
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceIContentProvider
-
inputChanged
public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- Specified by:
inputChanged
in interfaceIContentProvider
-
getElements
public Object[] getElements(Object inputElement)
- Specified by:
getElements
in interfaceIStructuredContentProvider
- Specified by:
getElements
in interfaceITreeContentProvider
-
getChildren
public Object[] getChildren(Object parentElement)
- Specified by:
getChildren
in interfaceITreeContentProvider
-
getParent
public Object getParent(Object element)
- Specified by:
getParent
in interfaceITreeContentProvider
-
hasChildren
public boolean hasChildren(Object element)
- Specified by:
hasChildren
in interfaceITreeContentProvider
-
-