public class AnnotationContentProvider extends Object implements IStructuredContentProvider, IAnnotationModelListenerExtension, IAnnotationModelListener
Annotation
s.
The content provider can be associated with AbstractTableViewer
s that
are fed with IAnnotationModel
s. The content provider with
automatically update the AbstractTableViewer
when the
IAnnotationModel
changes.
If you don't want to have all annotations the model delivers in your viewer, you can assign a filter to this viewer.
Constructor and Description |
---|
AnnotationContentProvider() |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
protected Annotation[] |
filter(Annotation[] unfiltered)
If a filter has been set, return only
those elements of the input for which the filter returns
true . |
protected Iterator<Annotation> |
filter(Iterator<Annotation> unfiltered)
If a filter has been set, return only
those elements of the input for which the filter returns
true . |
Object[] |
getElements(Object inputElement) |
void |
inputChanged(Viewer viewer,
Object oldInput,
Object newInput) |
void |
modelChanged(AnnotationModelEvent event) |
void |
modelChanged(IAnnotationModel model) |
void |
setFilter(com.google.common.base.Predicate<Annotation> filter)
Sets a filter for this content provider.
|
public void setFilter(com.google.common.base.Predicate<Annotation> filter)
true
to the
associated viewer. null
means no filtering.
If you call this method after you have initialized the associated viewer, the viewer will be refreshed.
protected Iterator<Annotation> filter(Iterator<Annotation> unfiltered)
true
. Returns the unmodified input otherwise.protected Annotation[] filter(Annotation[] unfiltered)
true
. Returns the unmodified input otherwise.
Note that this method creates an iterator over the input array and
allocates a new array after filtering, so if your input isn't an array,
use filter(Iterator)
.
public void dispose()
dispose
in interface IContentProvider
public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
inputChanged
in interface IContentProvider
public Object[] getElements(Object inputElement)
getElements
in interface IStructuredContentProvider
public void modelChanged(AnnotationModelEvent event)
modelChanged
in interface IAnnotationModelListenerExtension
public void modelChanged(IAnnotationModel model)
modelChanged
in interface IAnnotationModelListener