Class FlatteningTreeContentProvider
java.lang.Object
com._1c.g5.v8.dt.navigator.providers.FlatteningTreeContentProvider
- All Implemented Interfaces:
IContentProvider
,IStructuredContentProvider
,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 have
NavigatorContentProvider
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 the FlatteningTreeContentProvider
to flatten the
CatalogNavigatorAdapter.Folder
node and setup the tree viewer filter to show only
IWorkspaceRoot
, IProject
and Catalog
nodes.-
Constructor Summary
ConstructorsConstructorDescriptionFlatteningTreeContentProvider
(ITreeContentProvider sourceProvider, Class<?>... nodesToFlatten) Instantiates a new flattening tree content provider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Object[]
getChildren
(Object parentElement) Object[]
getElements
(Object inputElement) boolean
hasChildren
(Object element) void
inputChanged
(Viewer viewer, Object oldInput, Object newInput)
-
Constructor Details
-
FlatteningTreeContentProvider
public FlatteningTreeContentProvider(ITreeContentProvider sourceProvider, Class<?>... nodesToFlatten) Instantiates a new flattening tree content provider.- Parameters:
sourceProvider
- the source providernodesToFlatten
- the nodes to flatten
-
-
Method Details
-
dispose
public void dispose()- Specified by:
dispose
in interfaceIContentProvider
-
inputChanged
- Specified by:
inputChanged
in interfaceIContentProvider
-
getElements
- Specified by:
getElements
in interfaceIStructuredContentProvider
- Specified by:
getElements
in interfaceITreeContentProvider
-
getChildren
- Specified by:
getChildren
in interfaceITreeContentProvider
-
getParent
- Specified by:
getParent
in interfaceITreeContentProvider
-
hasChildren
- Specified by:
hasChildren
in interfaceITreeContentProvider
-