Package org.eclipse.jface.text.source
Interface IAnnotationModelExtension
- All Known Implementing Classes:
- AbstractMarkerAnnotationModel,- AnnotationModel,- ProjectionAnnotationModel,- ResourceMarkerAnnotationModel
public interface IAnnotationModelExtension
Extends 
IAnnotationModelwith the
 ability piggyback other annotation models. It also introduces the concept of
 modification time stamps and adds methods for richer manipulation methods.- Since:
- 3.0
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAnnotationModel(Object key, IAnnotationModel attachment) Attachesattachmentto the receiver.getAnnotationModel(Object key) Returns the attachedIAnnotationModelforkey, ornullif none is attached forkey.Returns the modification stamp of this annotation model.voidmodifyAnnotationPosition(Annotation annotation, Position position) Modifies the position associated with the given annotation to equal the given position.voidRemoves all annotations from this annotation model.Removes and returns the attachedIAnnotationModelforkey.voidreplaceAnnotations(Annotation[] annotationsToRemove, Map<? extends Annotation, ? extends Position> annotationsToAdd) Adds and removes annotations to/from this annotation model in a single step.
- 
Method Details- 
addAnnotationModelAttachesattachmentto the receiver. Connectsattachmentto the currently connected document. Ifattachmentis already attached (even) under a different key), it is not attached again.- Parameters:
- key- the key through which the attachment is identified.
- attachment- the attached- IAnnotationModel
 
- 
getAnnotationModelReturns the attachedIAnnotationModelforkey, ornullif none is attached forkey.- Parameters:
- key- the key through which the attachment is identified.
- Returns:
- an IAnnotationModelattached underkey, ornull
 
- 
removeAnnotationModelRemoves and returns the attachedIAnnotationModelforkey.- Parameters:
- key- the key through which the attachment is identified.
- Returns:
- an IAnnotationModelattached underkey, ornull
 
- 
replaceAnnotationsvoid replaceAnnotations(Annotation[] annotationsToRemove, Map<? extends Annotation, ? extends Position> annotationsToAdd) throws ClassCastExceptionAdds and removes annotations to/from this annotation model in a single step. The annotations to remove are given in an array. The annotations to add are provided in a map associating the annotations with the positions at which they should be added. All registered annotation model listeners are informed about the change. If the model is connected to a document, the positions are automatically updated on document changes. Annotations that are already managed by this annotation model or are not associated with a valid position in the connected document have no effect.- Parameters:
- annotationsToRemove- the annotations to be removed, may be- null
- annotationsToAdd- the annotations which will be added, may be- nulleach map entry has an- Annotationas key and a- Positionas value
- Throws:
- ClassCastException- if one of the map key or values has a wrong type
 
- 
modifyAnnotationPositionModifies the position associated with the given annotation to equal the given position. If the annotation is not yet managed by this annotation model, the annotation is added. If the given position isnullthe annotation is removed from the model. All annotation model change listeners will be informed about the change.- Parameters:
- annotation- the annotation whose associated position should be modified
- position- the position to whose values the associated position should be changed
 
- 
removeAllAnnotationsvoid removeAllAnnotations()Removes all annotations from this annotation model.
- 
getModificationStampObject getModificationStamp()Returns the modification stamp of this annotation model.- Returns:
- the modification stamp of this annotation model
 
 
-