Class ProjectionAnnotation
java.lang.Object
org.eclipse.jface.text.source.Annotation
org.eclipse.jface.text.source.projection.ProjectionAnnotation
- All Implemented Interfaces:
IAnnotationPresentation
Annotation used to represent the projection of a master document onto a
ProjectionDocument. A projection
annotation can be either expanded or collapsed. If expanded it corresponds to
a segment of the projection document. If collapsed, it represents a region of
the master document that does not have a corresponding segment in the
projection document.
Clients may subclass or use as is.
- Since:
- 3.0
-
Field Summary
FieldsFields inherited from class Annotation
TYPE_UNKNOWNFields inherited from interface IAnnotationPresentation
DEFAULT_LAYER -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new expanded projection annotation.ProjectionAnnotation(boolean isCollapsed) Creates a new projection annotation. -
Method Summary
Modifier and TypeMethodDescriptionintgetLayer()Returns the annotations drawing layer.protected booleanWhether this annotation should be included in the "Collapse All" action of the editor.booleanReturns the state of this annotation.voidMarks this annotation as being collapsed.voidMarks this annotation as being unfolded.voidImplement this method to draw a graphical representation of this annotation within the given bounds.voidsetRangeIndication(boolean rangeIndication) Enables and disables the range indication for this annotation.Methods inherited from class Annotation
getText, getType, isMarkedDeleted, isPersistent, markDeleted, setText, setType
-
Field Details
-
TYPE
-
-
Constructor Details
-
ProjectionAnnotation
public ProjectionAnnotation()Creates a new expanded projection annotation. -
ProjectionAnnotation
public ProjectionAnnotation(boolean isCollapsed) Creates a new projection annotation. WhenisCollapsedistruethe annotation is initially collapsed.- Parameters:
isCollapsed-trueif the annotation should initially be collapsed,falseotherwise
-
-
Method Details
-
setRangeIndication
public void setRangeIndication(boolean rangeIndication) Enables and disables the range indication for this annotation.- Parameters:
rangeIndication- the enable state for the range indication
-
paint
Description copied from interface:IAnnotationPresentationImplement this method to draw a graphical representation of this annotation within the given bounds.Note that this method is not used when drawing annotations on the editor's text widget. This is handled trough a
AnnotationPainter.IDrawingStrategy.- Specified by:
paintin interfaceIAnnotationPresentation- Parameters:
gc- the drawing GCcanvas- the canvas to draw onrectangle- the bounds inside the canvas to draw on
-
getLayer
public int getLayer()Description copied from interface:IAnnotationPresentationReturns the annotations drawing layer.- Specified by:
getLayerin interfaceIAnnotationPresentation- Returns:
- the annotations drawing layer
-
includeInCollapseAll
protected boolean includeInCollapseAll()Whether this annotation should be included in the "Collapse All" action of the editor.- Returns:
trueif the annotation participates in "Collapse All" actions- Since:
- 3.32
-
isCollapsed
public boolean isCollapsed()Returns the state of this annotation.- Returns:
trueif collapsed
-
markCollapsed
public void markCollapsed()Marks this annotation as being collapsed. -
markExpanded
public void markExpanded()Marks this annotation as being unfolded.
-