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
ConstructorsConstructorDescriptionCreates a new, empty projection annotation model. -
Method Summary
Modifier and TypeMethodDescriptionvoidcollapse(Annotation annotation) Changes the state of the given annotation to collapsed.booleancollapseAll(int offset, int length) Collapses all annotations that overlap with the given range and are collapsed.voidexpand(Annotation annotation) Changes the state of the given annotation to expanded.booleanexpandAll(int offset, int length) Expands all annotations that overlap with the given range and are collapsed.protected booleanexpandAll(int offset, int length, boolean fireModelChanged) Expands all annotations that overlap with the given range and are collapsed.voidmodifyAnnotations(Annotation[] deletions, Map<? extends Annotation, ? extends Position> additions, Annotation[] modifications) Modifies the annotation model.voidtoggleExpansionState(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:
trueif any annotation has been expanded,falseotherwise
-
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:
trueif any annotation has been collapse,falseotherwise- 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-trueif a model change event should be fired,falseotherwise- Returns:
trueif any annotation has been expanded,falseotherwise
-
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
-