|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.viewers.ViewerFilter
org.eclipse.ui.dialogs.PatternFilter
A filter used in conjunction with FilteredTree
. In order to
determine if a node should be filtered it uses the content provider of the
tree to do pattern matching on its children. This causes the entire tree
structure to be realized.
FilteredTree
Constructor Summary | |
---|---|
PatternFilter()
|
Method Summary | |
---|---|
Object[] |
filter(Viewer viewer,
Object parent,
Object[] elements)
Filters the given elements for the given viewer. |
boolean |
isElementSelectable(Object element)
Answers whether the given element is a valid selection in the filtered tree. |
boolean |
isElementVisible(Viewer viewer,
Object element)
Answers whether the given element in the given viewer matches the filter pattern. |
protected boolean |
isLeafMatch(Viewer viewer,
Object element)
Check if the current (leaf) element is a match with the filter text. |
protected boolean |
isParentMatch(Viewer viewer,
Object element)
Check if the parent (category) is a match to the filter text. |
boolean |
select(Viewer viewer,
Object parentElement,
Object element)
Returns whether the given element makes it through this filter. |
void |
setIncludeLeadingWildcard(boolean includeLeadingWildcard)
Sets whether a leading wildcard should be attached to each pattern string. |
void |
setPattern(String patternString)
The pattern string for which this filter should select elements in the viewer. |
protected boolean |
wordMatches(String text)
Return whether or not if any of the words in text satisfy the match critera. |
Methods inherited from class org.eclipse.jface.viewers.ViewerFilter |
---|
filter, isFilterProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PatternFilter()
Method Detail |
public final Object[] filter(Viewer viewer, Object parent, Object[] elements)
ViewerFilter
The default implementation of this method calls
select
on each element in the array,
and returns only those elements for which select
returns true
.
filter
in class ViewerFilter
viewer
- the viewerparent
- the parent elementelements
- the elements to filter
public final boolean select(Viewer viewer, Object parentElement, Object element)
ViewerFilter
select
in class ViewerFilter
viewer
- the viewerparentElement
- the parent elementelement
- the element
true
if element is included in the
filtered set, and false
if excludedpublic final void setIncludeLeadingWildcard(boolean includeLeadingWildcard)
includeLeadingWildcard
- Whether a leading wildcard should be added.public void setPattern(String patternString)
patternString
- public boolean isElementSelectable(Object element)
element
-
public boolean isElementVisible(Viewer viewer, Object element)
viewer
- the tree viewer in which the element resideselement
- the element in the tree to check for a match
protected boolean isParentMatch(Viewer viewer, Object element)
viewer
- the viewer that contains the elementelement
- the tree element to check
protected boolean isLeafMatch(Viewer viewer, Object element)
viewer
- the viewer that contains the elementelement
- the tree element to check
protected boolean wordMatches(String text)
text
- the text to match
true
if one of the words in text
satisifes the match criteria.
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.