public abstract class ViewerFilter extends Object
Subclasses must implement the select
method
and may implement the isFilterProperty
method.
IStructuredContentProvider
,
StructuredViewer
Modifier | Constructor and Description |
---|---|
protected |
ViewerFilter()
Creates a new viewer filter.
|
Modifier and Type | Method and Description |
---|---|
Object[] |
filter(Viewer viewer,
Object parent,
Object[] elements)
Filters the given elements for the given viewer.
|
Object[] |
filter(Viewer viewer,
TreePath parentPath,
Object[] elements)
Filters the given elements for the given viewer.
|
boolean |
isFilterProperty(Object element,
String property)
Returns whether this viewer filter would be affected
by a change to the given property of the given element.
|
abstract boolean |
select(Viewer viewer,
Object parentElement,
Object element)
Returns whether the given element makes it through this filter.
|
public Object[] filter(Viewer viewer, Object parent, Object[] elements)
The default implementation of this method calls
select
on each element in the array,
and returns only those elements for which select
returns true
.
viewer
- the viewerparent
- the parent elementelements
- the elements to filterpublic Object[] filter(Viewer viewer, TreePath parentPath, Object[] elements)
The default implementation of this method calls
filter(Viewer, Object, Object[])
with the
parent from the path. Subclasses may override
viewer
- the viewerparentPath
- the path of the parent elementelements
- the elements to filterpublic boolean isFilterProperty(Object element, String property)
The default implementation of this method returns false
.
Subclasses should reimplement.
element
- the elementproperty
- the propertytrue
if the filtering would be affected,
and false
if it would be unaffectedpublic abstract boolean select(Viewer viewer, Object parentElement, Object element)
viewer
- the viewerparentElement
- the parent elementelement
- the elementtrue
if element is included in the
filtered set, and false
if excluded
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.