Class FilteringTreeContentProvider
java.lang.Object
com._1c.g5.v8.dt.navigator.providers.FilteringTreeContentProvider
- All Implemented Interfaces:
IContentProvider
,IStructuredContentProvider
,ITreeContentProvider
- Direct Known Subclasses:
CommandFilteringTreeContentProvider
,ContainmentTreeContentProvider
,FormFilteringTreeContentProvider
,RoleFilteringTreeContentProvider
,SubsystemFilteringTreeContentProvider
The implementation of
ITreeContentProvider
. When you call methods
getElements(Object)
and
getChildren(Object)
to filter children it firstly tries
to use ISubtreeInducer
if possible, then uses TreeItemFilter
's.
ISubtreeInducer
is needed in order to at first move quickly from the source tree to its subtree and
then apply TreeItemFilter
's on its subtree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe tree nodes having matching descendants.protected final ITreeContentProvider
The source provider.protected final ISubtreeInducer
protected final TreeItemFilter[]
-
Constructor Summary
ConstructorsConstructorDescriptionFilteringTreeContentProvider
(ITreeContentProvider sourceProvider, ISubtreeInducer subtreeInducer, TreeItemFilter... treeItemFilters) Creates a new instance with the given parameters.FilteringTreeContentProvider
(ITreeContentProvider sourceProvider, TreeItemFilter... treeItemFilters) Creates a new instance with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
protected void
Drops all collected cache.protected Object[]
filterChildren
(Object[] children) Filters the given children.protected Object[]
filterChildrenBySubtreeInducer
(Object parent, Object[] children) Filters children of the given parent element byISubtreeInducer
.Object[]
getChildren
(Object parentElement) Object[]
getElements
(Object inputElement) protected boolean
hasAnyMatchingChildren
(Object element) Determines if the given tree element has any matching children in its subtree, that is at least one matching child.boolean
hasChildren
(Object element) boolean
hasChildrenLightweight
(Object element) Returns whether the given element has children, no heavy calculations and no callinggetChildren(Object)
method.protected boolean
hasMatchingDescendants
(Object element) Determines if the given tree element has matching descendants in its subtree.protected boolean
Determines if the specified node may have children from the source tree that are not the induced subgraph nodes.void
inputChanged
(Viewer viewer, Object oldInput, Object newInput) protected boolean
inSubgraph
(Object node) Determines if the given node belongs to the induced subgraph.protected boolean
isSubgraphInnerNode
(Object element) Determines if the specified element is inner node in the induced subgraph.protected boolean
Determines if to keep the given child or filter it out.
-
Field Details
-
hasMatchingDescendants
The tree nodes having matching descendants. -
sourceProvider
The source provider. -
subtreeInducer
-
treeItemFilters
-
-
Constructor Details
-
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
-
hasChildrenLightweight
Returns whether the given element has children, no heavy calculations and no callinggetChildren(Object)
method.- Parameters:
element
- the given element, can not benull
- Returns:
true
if the given element has children, andfalse
if it has no children
-
hasMatchingDescendants
Determines if the given tree element has matching descendants in its subtree.- Parameters:
element
- the given tree element, can not benull
- Returns:
true
if the given tree element has matching descendants in its subtree andfalse
otherwise
-
hasAnyMatchingChildren
Determines if the given tree element has any matching children in its subtree, that is at least one matching child.- Parameters:
element
- the given tree element, can not benull
- Returns:
true
if the given tree element has any matching children in its subtree andfalse
otherwise
-
filterChildrenBySubtreeInducer
Filters children of the given parent element byISubtreeInducer
. Keeps children that got into the set of vertices generated byISubtreeInducer
.- Parameters:
parent
- the parent element, can not benull
children
- the children elements, can not benull
- Returns:
- the filtered children, can not be
null
-
filterChildren
Filters the given children.- Parameters:
children
- the given children elements, can not benull
- Returns:
- the filtered children, can not be
null
-
inSubgraph
Determines if the given node belongs to the induced subgraph.- Parameters:
node
- the given node from the source tree, can not benull
- Returns:
true
the given node belongs to the induced subgraph andfalse
otherwise
-
isSubgraphInnerNode
Determines if the specified element is inner node in the induced subgraph.- Parameters:
element
- the specified node from the origin tree, can not benull
- Returns:
true
if the specified node is inner node in the induced subgraph andfalse
otherwise
-
hasOuterToSubtreeChildren
Determines if the specified node may have children from the source tree that are not the induced subgraph nodes.- Parameters:
node
- the specified node from the origin tree, can not benull
- Returns:
true
if the specified node may have children from the source tree that are not the induced subgraph nodes andfalse
otherwise
-
dropCache
protected void dropCache()Drops all collected cache. -
keepChild
Determines if to keep the given child or filter it out.- Parameters:
child
- the given child, can not benull
- Returns:
true
to keep the given child,false
to filter it out
-