Package com.im.ijc.core.api.util
Class NodeFilter
- java.lang.Object
-
- com.im.ijc.core.api.util.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)
- The name contains all filter words.
- If there are two filter words
Longer
andShorter
whereShorter
is a substring ofLonger
, then the name lessLonger
must still containShorter
. This means that filtercompound com
will not matchcompound tree
, but it will matchcommunist compound
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 forNodeFilter
.
-
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.
-
-
-
Constructor Detail
-
NodeFilter
public NodeFilter(java.lang.String filter, java.lang.Class<? extends org.openide.nodes.Node.Cookie>... cookies)
Constructor forNodeFilter
.- 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.
-
-