public interface IAnnotationModel
In order to provide backward compatibility for clients of IAnnotationModel
, extension
interfaces are used to provide a means of evolution. The following extension interfaces
exist:
IAnnotationModelExtension
since version 3.0 introducing the concept
of model piggybacking annotation models, modification time stamps, and enhanced manipulation methods.
IAnnotationModelExtension2
since version 3.4 allows to retrieve
annotations within a given region.
AnnotationModel
.Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(Annotation annotation,
Position position)
Adds a annotation to this annotation model.
|
void |
addAnnotationModelListener(IAnnotationModelListener listener)
Registers the annotation model listener with this annotation model.
|
void |
connect(IDocument document)
Connects the annotation model to a document.
|
void |
disconnect(IDocument document)
Disconnects this model from a document.
|
Iterator |
getAnnotationIterator()
Returns all annotations managed by this model.
|
Position |
getPosition(Annotation annotation)
Returns the position associated with the given annotation.
|
void |
removeAnnotation(Annotation annotation)
Removes the given annotation from the model.
|
void |
removeAnnotationModelListener(IAnnotationModelListener listener)
Removes the listener from the model's list of annotation model listeners.
|
void addAnnotationModelListener(IAnnotationModelListener listener)
listener
- the listener to be registered, may not be null
void removeAnnotationModelListener(IAnnotationModelListener listener)
listener
- the listener to be removed, may not be null
void connect(IDocument document)
connect
calls must mention the document the
model is already connected to. An annotation model primarily uses
connect
and disconnect
for reference counting
the document. Reference counting frees the clients from keeping tracker
whether a model has already been connected to a document.document
- the document the model gets connected to,
may not be null
disconnect(IDocument)
void disconnect(IDocument document)
document
- the document the model gets disconnected from,
may not be null
for further specification details
void addAnnotation(Annotation annotation, Position position)
Performance hint: Use IAnnotationModelExtension.replaceAnnotations(Annotation[], java.util.Map)
if several annotations are added and/or removed.
annotation
- the annotation to add, may not be null
position
- the position describing the range covered by this annotation,
may not be null
void removeAnnotation(Annotation annotation)
Performance hint: Use IAnnotationModelExtension.replaceAnnotations(Annotation[], java.util.Map)
if several annotations are removed and/or added.
annotation
- the annotation to be removed from this model,
may not be null
Iterator getAnnotationIterator()
Annotation
)Position getPosition(Annotation annotation)
annotation
- the annotation whose position should be returnednull
if no
associated annotation exists
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.