Package org.eclipse.ui.texteditor
Class ResourceMarkerAnnotationModel
java.lang.Object
org.eclipse.jface.text.source.AnnotationModel
org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel
org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel
- All Implemented Interfaces:
IPersistableAnnotationModel,ISynchronizable,IAnnotationModel,IAnnotationModelExtension,IAnnotationModelExtension2
A marker annotation model whose underlying source of markers is
a resource in the workspace.
This class may be instantiated; it is not intended to be subclassed.
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from class org.eclipse.jface.text.source.AnnotationModel
fAnnotationModelListeners, fAnnotations, fDocument -
Constructor Summary
ConstructorsConstructorDescriptionResourceMarkerAnnotationModel(IResource resource) Creates a marker annotation model with the given resource as the source of the markers. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteMarkers(IMarker[] markers) Deletes the given markers from this model.protected IResourceReturns the resource serving as the source of markers for this annotation model.protected booleanisAcceptable(IMarker marker) Determines whether the marker is acceptable as an addition to this model.protected voidlistenToMarkerChanges(boolean listen) Tells the model whether it should listen for marker changes.protected IMarker[]Retrieves all markers from this model.protected voidupdate(IMarkerDelta[] markerDeltas) Updates this model to the given marker deltas.Methods inherited from class org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel
addMarkerAnnotation, addMarkerUpdater, commit, connected, createMarkerAnnotation, createPositionFromMarker, disconnected, getMarkerAnnotation, getMarkerPosition, handleCoreException, modifyMarkerAnnotation, reinitialize, removeAnnotations, removeMarkerAnnotation, removeMarkerUpdater, resetMarkers, revert, updateMarker, updateMarker, updateMarkersMethods inherited from class org.eclipse.jface.text.source.AnnotationModel
addAnnotation, addAnnotation, addAnnotationModel, addAnnotationModelListener, addPosition, cleanup, connect, createAnnotationModelEvent, disconnect, fireModelChanged, fireModelChanged, getAnnotationIterator, getAnnotationIterator, getAnnotationIterator, getAnnotationMap, getAnnotationModel, getAnnotationModelEvent, getLockObject, getModificationStamp, getPosition, modifyAnnotation, modifyAnnotationPosition, modifyAnnotationPosition, removeAllAnnotations, removeAllAnnotations, removeAnnotation, removeAnnotation, removeAnnotationModel, removeAnnotationModelListener, removePosition, replaceAnnotations, replaceAnnotations, setLockObject
-
Constructor Details
-
ResourceMarkerAnnotationModel
Creates a marker annotation model with the given resource as the source of the markers.- Parameters:
resource- the resource
-
-
Method Details
-
isAcceptable
Description copied from class:AbstractMarkerAnnotationModelDetermines whether the marker is acceptable as an addition to this model. If the marker, say, represents an aspect or range of no interest to this model, the marker is rejected.Subclasses must implement this method.
- Specified by:
isAcceptablein classAbstractMarkerAnnotationModel- Parameters:
marker- the marker- Returns:
trueif the marker is acceptable
-
update
Updates this model to the given marker deltas.- Parameters:
markerDeltas- the array of marker deltas
-
listenToMarkerChanges
protected void listenToMarkerChanges(boolean listen) Description copied from class:AbstractMarkerAnnotationModelTells the model whether it should listen for marker changes.Subclasses must implement this method.
- Specified by:
listenToMarkerChangesin classAbstractMarkerAnnotationModel- Parameters:
listen-trueif this model should listen, andfalseotherwise
-
deleteMarkers
Description copied from class:AbstractMarkerAnnotationModelDeletes the given markers from this model.Subclasses must implement this method.
- Specified by:
deleteMarkersin classAbstractMarkerAnnotationModel- Parameters:
markers- the array of markers- Throws:
CoreException- if there are problems deleting the markers
-
retrieveMarkers
Description copied from class:AbstractMarkerAnnotationModelRetrieves all markers from this model.Subclasses must implement this method.
- Specified by:
retrieveMarkersin classAbstractMarkerAnnotationModel- Returns:
- the list of markers
- Throws:
CoreException- if there is a problem getting the markers
-
getResource
Returns the resource serving as the source of markers for this annotation model.- Returns:
- the resource serving as the source of markers for this annotation model
- Since:
- 2.0
-