Class NodeFilter


  • public final class NodeFilter
    extends java.lang.Object
    Filters nodes by display name. The filter parameter is split by whitespace characters. isNodeMatchingFilter(org.openide.nodes.Node) contains all words from filter. The comparison is case insensitive. The node is matching the filter criteria only if the node is having at least one Node.Cookie from cookie parameters. If no cookies are defined, the node matching the criteria.
    The node is matching filter when:
    • node's display name matching the filter
    • node's display name doesn't contain filters but it has a child matching the filter
    • parent's display name matching the filter ( => all child node matches filter)
    Filter matches the name when both following conditions are met:
    • The name contains all filter words.
    • If there are two filter words Longer and Shorter where Shorter is a substring of Longer, then the name less Longer must still contain Shorter. This means that filter compound com will not match compound tree, but it will match communist compound
    the string after removing X has to contain Y.
    Empty filter means no filter defined -> every Node matches the filter.
    Since:
    6.3.1
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeFilter​(java.lang.String filter, java.lang.Class<? extends org.openide.nodes.Node.Cookie>... cookies)
      Constructor for NodeFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isNodeMatchingFilter​(org.openide.nodes.Node node)
      Tests the node whether matches the filtering criteria.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeFilter

        public NodeFilter​(java.lang.String filter,
                          java.lang.Class<? extends org.openide.nodes.Node.Cookie>... cookies)
        Constructor for NodeFilter.
        Parameters:
        filter - The filter string. Will be split by whitespace characters.
        cookies - (Optional) List of cookies. The node must have at least one of those cookies to match the filter criteria.
    • Method Detail

      • isNodeMatchingFilter

        public boolean isNodeMatchingFilter​(org.openide.nodes.Node node)
        Tests the node whether matches the filtering criteria.
        Parameters:
        node - the node to filter.
        Returns:
        see above.