|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the model for managing annotations attached to a document. The model maintains a set of annotations for a given document and notifies registered annotation model listeners about annotation model changes. It also provides methods for querying the current position of an annotation managed by this model.
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.
AnnotationModel
.
IAnnotationModelExtension
,
Annotation
,
IAnnotationModelListener
Method Summary | |
---|---|
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. |
Method Detail |
public void addAnnotationModelListener(IAnnotationModelListener listener)
listener
- the listener to be registered, may not be null
public void removeAnnotationModelListener(IAnnotationModelListener listener)
listener
- the listener to be removed, may not be null
public 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)
public void disconnect(IDocument document)
document
- the document the model gets disconnected from,
may not be null
for further specification details
public void addAnnotation(Annotation annotation, Position position)
annotation
- the annotation to add, may not be null
position
- the position describing the range covered by this annotation,
may not be null
public void removeAnnotation(Annotation annotation)
annotation
- the annotation to be removed from this model,
may not be null
public Iterator getAnnotationIterator()
public Position getPosition(Annotation annotation)
annotation
- the annotation whose position should be returned
null
if no
associated annotation exists
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.