public class AnnotationRulerColumn extends Object implements IVerticalRulerColumn, IVerticalRulerInfo, IVerticalRulerInfoExtension
Do not subclass.
Constructor and Description |
---|
AnnotationRulerColumn(IAnnotationModel model,
int width)
Constructs this column with the given arguments.
|
AnnotationRulerColumn(IAnnotationModel model,
int width,
IAnnotationAccess annotationAccess)
Constructs this column with the given arguments.
|
AnnotationRulerColumn(int width)
Constructs this column with the given width.
|
AnnotationRulerColumn(int width,
IAnnotationAccess annotationAccess)
Constructs this column with the given arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationType(Object annotationType)
Adds the given annotation type to this annotation ruler column.
|
void |
addVerticalRulerListener(IVerticalRulerListener listener)
Registers a vertical ruler listener to be informed if an annotation gets
selected on the vertical ruler.
|
Control |
createControl(CompositeRuler parentRuler,
Composite parentControl)
Creates the column's SWT control.
|
protected void |
doPaint(GC gc)
Draws the vertical ruler w/o drawing the Canvas background.
|
protected void |
doPaint1(GC gc)
Draws the vertical ruler w/o drawing the Canvas background.
|
protected ITextViewer |
getCachedTextViewer()
Returns the cached text viewer.
|
Control |
getControl()
Returns the column's SWT control.
|
IAnnotationHover |
getHover()
Returns the hover for this vertical ruler (column).
|
protected int |
getInclusiveTopIndexStartOffset()
Returns the document offset of the upper left corner of the source viewer's
view port, possibly including partially visible lines.
|
int |
getLineOfLastMouseButtonActivity()
Returns the line number of the last mouse button activity.
|
IAnnotationModel |
getModel()
Returns the model currently used by the receiver.
|
int |
getWidth()
Returns the width of this column's control.
|
protected boolean |
hasAnnotation(int lineNumber)
Tells whether the given line contains an annotation.
|
protected boolean |
isPropagatingMouseListener()
Tells whether this ruler column propagates mouse listener
events to its parent.
|
protected void |
mouseClicked(int rulerLine)
Hook method for a mouse click event on the given ruler line.
|
protected void |
mouseDoubleClicked(int rulerLine)
Hook method for a mouse double click event on the given ruler line.
|
protected void |
mouseDown(int rulerLine)
Hook method for a mouse down event on the given ruler line.
|
void |
redraw()
Redraws this column.
|
void |
removeAnnotationType(Object annotationType)
Removes the given annotation type from this annotation ruler column.
|
void |
removeVerticalRulerListener(IVerticalRulerListener listener)
Removes a previously registered listener.
|
void |
setFont(Font font)
Sets the font of this ruler column.
|
void |
setHover(IAnnotationHover hover) |
void |
setModel(IAnnotationModel model)
Associates an annotation model with this ruler column.
|
int |
toDocumentLineNumber(int y_coordinate)
Translates a y-coordinate of the ruler's SWT control into
the according line number of the document of the connected text viewer.
|
public AnnotationRulerColumn(IAnnotationModel model, int width, IAnnotationAccess annotationAccess)
model
- the annotation model to get the annotations fromwidth
- the width of the vertical rulerannotationAccess
- the annotation accesspublic AnnotationRulerColumn(int width, IAnnotationAccess annotationAccess)
width
- the width of the vertical rulerannotationAccess
- the annotation accesspublic AnnotationRulerColumn(IAnnotationModel model, int width)
model
- the annotation model to get the annotations fromwidth
- the width of the vertical rulerpublic AnnotationRulerColumn(int width)
width
- the width of the vertical rulerpublic Control getControl()
IVerticalRulerColumn
getControl
in interface IVerticalRulerColumn
getControl
in interface IVerticalRulerInfo
public int getWidth()
IVerticalRulerColumn
getWidth
in interface IVerticalRulerColumn
getWidth
in interface IVerticalRulerInfo
public Control createControl(CompositeRuler parentRuler, Composite parentControl)
IVerticalRulerColumn
createControl
in interface IVerticalRulerColumn
parentRuler
- the parent ruler of this columnparentControl
- the control of the parent rulerprotected boolean isPropagatingMouseListener()
true
if propagating to parentprotected void mouseDown(int rulerLine)
rulerLine
- the ruler lineprotected void mouseDoubleClicked(int rulerLine)
rulerLine
- the ruler lineprotected void mouseClicked(int rulerLine)
Note: The event is sent on mouse up.
rulerLine
- the ruler lineprotected boolean hasAnnotation(int lineNumber)
lineNumber
- the line numbertrue
if the given line contains an annotationprotected int getInclusiveTopIndexStartOffset()
protected void doPaint(GC gc)
gc
- the GC to draw intoprotected void doPaint1(GC gc)
ITextViewerExtension5
. Will replace doPaint(GC)
.gc
- the GC to draw intopublic void redraw()
IVerticalRulerColumn
redraw
in interface IVerticalRulerColumn
public void setModel(IAnnotationModel model)
IVerticalRulerColumn
null
is acceptable and clears the ruler.setModel
in interface IVerticalRulerColumn
model
- the new annotation model, may be null
public void setFont(Font font)
IVerticalRulerColumn
setFont
in interface IVerticalRulerColumn
font
- the new font of the ruler columnprotected ITextViewer getCachedTextViewer()
public IAnnotationModel getModel()
IVerticalRulerInfoExtension
getModel
in interface IVerticalRulerInfoExtension
null
if no model is
installed.public void addAnnotationType(Object annotationType)
annotationType
- the annotation typepublic int getLineOfLastMouseButtonActivity()
IVerticalRulerInfo
getLineOfLastMouseButtonActivity
in interface IVerticalRulerInfo
-1
if
the last mouse activity does not correspond to a valid document linepublic int toDocumentLineNumber(int y_coordinate)
IVerticalRulerInfo
toDocumentLineNumber
in interface IVerticalRulerInfo
y_coordinate
- a y-coordinate of the ruler's SWT control-1
if that
coordinate does not correspond to a valid document linepublic void removeAnnotationType(Object annotationType)
annotationType
- the annotation typepublic IAnnotationHover getHover()
IVerticalRulerInfoExtension
getHover
in interface IVerticalRulerInfoExtension
public void setHover(IAnnotationHover hover)
hover
- The hover to set.public void addVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtension
addVerticalRulerListener
in interface IVerticalRulerInfoExtension
listener
- the listener to be informedpublic void removeVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtension
listener
is not registered
with the receiver, calling this method has no effect.removeVerticalRulerListener
in interface IVerticalRulerInfoExtension
listener
- the listener to be removed
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.