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.
|
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()
IVerticalRulerColumngetControl in interface IVerticalRulerColumngetControl in interface IVerticalRulerInfopublic int getWidth()
IVerticalRulerColumngetWidth in interface IVerticalRulerColumngetWidth in interface IVerticalRulerInfopublic Control createControl(CompositeRuler parentRuler, Composite parentControl)
IVerticalRulerColumncreateControl in interface IVerticalRulerColumnparentRuler - the parent ruler of this columnparentControl - the control of the parent rulerprotected boolean isPropagatingMouseListener()
true if propagating to parentprotected void mouseDoubleClicked(int rulerLine)
rulerLine - the ruler lineprotected void mouseClicked(int rulerLine)
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()
IVerticalRulerColumnredraw in interface IVerticalRulerColumnpublic void setModel(IAnnotationModel model)
IVerticalRulerColumnnull is acceptable and clears the ruler.setModel in interface IVerticalRulerColumnmodel - the new annotation model, may be nullpublic void setFont(Font font)
IVerticalRulerColumnsetFont in interface IVerticalRulerColumnfont - the new font of the ruler columnprotected ITextViewer getCachedTextViewer()
public IAnnotationModel getModel()
IVerticalRulerInfoExtensiongetModel in interface IVerticalRulerInfoExtensionnull if no model is
installed.public void addAnnotationType(Object annotationType)
annotationType - the annotation typepublic int getLineOfLastMouseButtonActivity()
IVerticalRulerInfo0.getLineOfLastMouseButtonActivity in interface IVerticalRulerInfopublic int toDocumentLineNumber(int y_coordinate)
IVerticalRulerInfotoDocumentLineNumber in interface IVerticalRulerInfoy_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()
IVerticalRulerInfoExtensiongetHover in interface IVerticalRulerInfoExtensionpublic void setHover(IAnnotationHover hover)
hover - The hover to set.public void addVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtensionaddVerticalRulerListener in interface IVerticalRulerInfoExtensionlistener - the listener to be informedpublic void removeVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtensionlistener is not registered
with the receiver, calling this method has no effect.removeVerticalRulerListener in interface IVerticalRulerInfoExtensionlistener - the listener to be removedGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.