public class ProjectionAnnotation extends Annotation implements IAnnotationPresentation
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.
Modifier and Type | Field and Description |
---|---|
static String |
TYPE
The type of projection annotations.
|
TYPE_UNKNOWN
DEFAULT_LAYER
Constructor and Description |
---|
ProjectionAnnotation()
Creates a new expanded projection annotation.
|
ProjectionAnnotation(boolean isCollapsed)
Creates a new projection annotation.
|
Modifier and Type | Method and Description |
---|---|
int |
getLayer()
Returns the annotations drawing layer.
|
boolean |
isCollapsed()
Returns the state of this annotation.
|
void |
markCollapsed()
Marks this annotation as being collapsed.
|
void |
markExpanded()
Marks this annotation as being unfolded.
|
void |
paint(GC gc,
Canvas canvas,
Rectangle rectangle)
Implement this method to draw a graphical representation
of this annotation within the given bounds.
|
void |
setRangeIndication(boolean rangeIndication)
Enables and disables the range indication for this annotation.
|
getText, getType, isMarkedDeleted, isPersistent, markDeleted, setText, setType
public static final String TYPE
public ProjectionAnnotation()
public ProjectionAnnotation(boolean isCollapsed)
isCollapsed
is true
the annotation is initially collapsed.isCollapsed
- true
if the annotation should initially be collapsed, false
otherwisepublic void setRangeIndication(boolean rangeIndication)
rangeIndication
- the enable state for the range indicationpublic void paint(GC gc, Canvas canvas, Rectangle rectangle)
IAnnotationPresentation
Note that this method is not used when drawing annotations on the editor's
text widget. This is handled trough a AnnotationPainter.IDrawingStrategy
.
paint
in interface IAnnotationPresentation
gc
- the drawing GCcanvas
- the canvas to draw onrectangle
- the bounds inside the canvas to draw onpublic int getLayer()
IAnnotationPresentation
getLayer
in interface IAnnotationPresentation
public boolean isCollapsed()
true
if collapsedpublic void markCollapsed()
public void markExpanded()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.