Class ProjectionAnnotationModel
java.lang.Object
org.eclipse.jface.text.source.AnnotationModel
org.eclipse.jface.text.source.projection.ProjectionAnnotationModel
- All Implemented Interfaces:
ISynchronizable
,IAnnotationModel
,IAnnotationModelExtension
,IAnnotationModelExtension2
A projection annotation model. It provides methods for modifying the
expansion state of the managed projection annotations.
Do not subclass. Use it as is.
- Since:
- 3.0
- 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
ConstructorDescriptionCreates a new, empty projection annotation model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
collapse
(Annotation annotation) Changes the state of the given annotation to collapsed.boolean
collapseAll
(int offset, int length) Collapses all annotations that overlap with the given range and are collapsed.void
expand
(Annotation annotation) Changes the state of the given annotation to expanded.boolean
expandAll
(int offset, int length) Expands all annotations that overlap with the given range and are collapsed.protected boolean
expandAll
(int offset, int length, boolean fireModelChanged) Expands all annotations that overlap with the given range and are collapsed.void
modifyAnnotations
(Annotation[] deletions, Map<? extends Annotation, ? extends Position> additions, Annotation[] modifications) Modifies the annotation model.void
toggleExpansionState
(Annotation annotation) Toggles the expansion state of the given annotation.Methods inherited from class org.eclipse.jface.text.source.AnnotationModel
addAnnotation, addAnnotation, addAnnotationModel, addAnnotationModelListener, addPosition, cleanup, connect, connected, createAnnotationModelEvent, disconnect, disconnected, fireModelChanged, fireModelChanged, getAnnotationIterator, getAnnotationIterator, getAnnotationIterator, getAnnotationMap, getAnnotationModel, getAnnotationModelEvent, getLockObject, getModificationStamp, getPosition, modifyAnnotation, modifyAnnotationPosition, modifyAnnotationPosition, removeAllAnnotations, removeAllAnnotations, removeAnnotation, removeAnnotation, removeAnnotationModel, removeAnnotationModelListener, removeAnnotations, removePosition, replaceAnnotations, replaceAnnotations, setLockObject
-
Constructor Details
-
ProjectionAnnotationModel
public ProjectionAnnotationModel()Creates a new, empty projection annotation model.
-
-
Method Details
-
collapse
Changes the state of the given annotation to collapsed. An appropriate annotation model change event is sent out.- Parameters:
annotation
- the annotation
-
expand
Changes the state of the given annotation to expanded. An appropriate annotation model change event is sent out.- Parameters:
annotation
- the annotation
-
toggleExpansionState
Toggles the expansion state of the given annotation. An appropriate annotation model change event is sent out.- Parameters:
annotation
- the annotation
-
expandAll
public boolean expandAll(int offset, int length) Expands all annotations that overlap with the given range and are collapsed.- Parameters:
offset
- the range offsetlength
- the range length- Returns:
true
if any annotation has been expanded,false
otherwise
-
collapseAll
public boolean collapseAll(int offset, int length) Collapses all annotations that overlap with the given range and are collapsed.- Parameters:
offset
- the range offsetlength
- the range length- Returns:
true
if any annotation has been collapse,false
otherwise- Since:
- 3.2
-
expandAll
protected boolean expandAll(int offset, int length, boolean fireModelChanged) Expands all annotations that overlap with the given range and are collapsed. Fires a model change event if requested.- Parameters:
offset
- the offset of the rangelength
- the length of the rangefireModelChanged
-true
if a model change event should be fired,false
otherwise- Returns:
true
if any annotation has been expanded,false
otherwise
-
modifyAnnotations
public void modifyAnnotations(Annotation[] deletions, Map<? extends Annotation, ? extends Position> additions, Annotation[] modifications) Modifies the annotation model.- Parameters:
deletions
- the list of deleted annotationsadditions
- the set of annotations to add together with their associated positionmodifications
- the list of modified annotations
-