Class FilteringTreeContentProvider

    • Field Detail

      • hasMatchingDescendants

        protected Set<Object> hasMatchingDescendants
        The tree nodes having matching descendants.
    • Constructor Detail

      • FilteringTreeContentProvider

        public FilteringTreeContentProvider​(ITreeContentProvider sourceProvider,
                                            TreeItemFilter... treeItemFilters)
        Creates a new instance with the given parameters. Uses only TreeItemFilter's to filter the tree nodes.
        Parameters:
        sourceProvider - the source provider, can not be null
        treeItemFilters - the TreeItemFilter's to apply, can not be null
    • Method Detail

      • hasChildrenLightweight

        public boolean hasChildrenLightweight​(Object element)
        Returns whether the given element has children, no heavy calculations and no calling getChildren(Object) method.
        Parameters:
        element - the given element, can not be null
        Returns:
        true if the given element has children, and false if it has no children
      • hasMatchingDescendants

        protected boolean hasMatchingDescendants​(Object element)
        Determines if the given tree element has matching descendants in its subtree.
        Parameters:
        element - the given tree element, can not be null
        Returns:
        true if the given tree element has matching descendants in its subtree and false otherwise
      • hasAnyMatchingChildren

        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.
        Parameters:
        element - the given tree element, can not be null
        Returns:
        true if the given tree element has any matching children in its subtree and false otherwise
      • filterChildrenBySubtreeInducer

        protected Object[] filterChildrenBySubtreeInducer​(Object parent,
                                                          Object[] children)
        Filters children of the given parent element by ISubtreeInducer. Keeps children that got into the set of vertices generated by ISubtreeInducer.
        Parameters:
        parent - the parent element, can not be null
        children - the children elements, can not be null
        Returns:
        the filtered children, can not be null
      • filterChildren

        protected Object[] filterChildren​(Object[] children)
        Filters the given children.
        Parameters:
        children - the given children elements, can not be null
        Returns:
        the filtered children, can not be null
      • inSubgraph

        protected boolean inSubgraph​(Object node)
        Determines if the given node belongs to the induced subgraph.
        Parameters:
        node - the given node from the source tree, can not be null
        Returns:
        true the given node belongs to the induced subgraph and false otherwise
      • isSubgraphInnerNode

        protected boolean isSubgraphInnerNode​(Object element)
        Determines if the specified element is inner node in the induced subgraph.
        Parameters:
        element - the specified node from the origin tree, can not be null
        Returns:
        true if the specified node is inner node in the induced subgraph and false otherwise
      • hasOuterToSubtreeChildren

        protected boolean hasOuterToSubtreeChildren​(Object node)
        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 be null
        Returns:
        true if the specified node may have children from the source tree that are not the induced subgraph nodes and false otherwise
      • dropCache

        protected void dropCache()
        Drops all collected cache.
      • keepChild

        protected boolean keepChild​(Object child)
        Determines if to keep the given child or filter it out.
        Parameters:
        child - the given child, can not be null
        Returns:
        true to keep the given child, false to filter it out