XViewerPatternFilter
public class PatternFilter
extends org.eclipse.jface.viewers.ViewerFilter
FilteredTree
. In order to determine if a node should be filtered it
uses the content and label provider of the tree to do pattern matching on its children. This causes the entire tree
structure to be realized. Note that the label provider must implement ILabelProvider.FilteredTree
Constructor | Description |
---|---|
PatternFilter() |
Modifier and Type | Method | Description |
---|---|---|
void |
clearCaches() |
Clears the caches used for optimizing this filter.
|
java.lang.Object[] |
filter(org.eclipse.jface.viewers.Viewer viewer,
java.lang.Object parent,
java.lang.Object[] elements) |
|
boolean |
isElementSelectable(java.lang.Object element) |
Answers whether the given element is a valid selection in the filtered tree.
|
boolean |
isElementVisible(org.eclipse.jface.viewers.Viewer viewer,
java.lang.Object element) |
Answers whether the given element in the given viewer matches the filter pattern.
|
boolean |
isLeafMatch(org.eclipse.jface.viewers.Viewer viewer,
java.lang.Object element) |
Check if the current (leaf) element is a match with the filter text.
|
boolean |
select(org.eclipse.jface.viewers.Viewer viewer,
java.lang.Object parentElement,
java.lang.Object element) |
|
void |
setIncludeLeadingWildcard(boolean includeLeadingWildcard) |
Sets whether a leading wildcard should be attached to each pattern string.
|
void |
setPattern(java.lang.String patternString) |
The pattern string for which this filter should select elements in the viewer.
|
void |
setUseCache(boolean useCache) |
Can be called by the filtered tree to turn on caching.
|
public final java.lang.Object[] filter(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parent, java.lang.Object[] elements)
filter
in class org.eclipse.jface.viewers.ViewerFilter
public final boolean select(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parentElement, java.lang.Object element)
select
in class org.eclipse.jface.viewers.ViewerFilter
public final void setIncludeLeadingWildcard(boolean includeLeadingWildcard)
includeLeadingWildcard
- Whether a leading wildcard should be added.public void setPattern(java.lang.String patternString)
patternString
- public void clearCaches()
public boolean isElementSelectable(java.lang.Object element)
element
- public boolean isElementVisible(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object element)
viewer
- the tree viewer in which the element resideselement
- the element in the tree to check for a matchpublic boolean isLeafMatch(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object element)
viewer
- the viewer that contains the elementelement
- the tree element to checkpublic void setUseCache(boolean useCache)
useCache
- The useCache to set.