public class OverviewRuler extends Object implements IOverviewRuler
Clients usually instantiate and configure objects of this class.
| Constructor and Description |
|---|
OverviewRuler(IAnnotationAccess annotationAccess,
int width,
ISharedTextColors sharedColors)
Constructs a overview ruler of the given width using the given annotation access and the given
color manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotationType(Object annotationType)
Adds the given annotation type to this overview ruler.
|
void |
addHeaderAnnotationType(Object annotationType)
Adds the given annotation type to the header of this ruler.
|
Control |
createControl(Composite parent,
ITextViewer textViewer)
Creates the ruler's SWT control.
|
int |
getAnnotationHeight()
Returns the height of the visual presentation of an annotation in this
overview ruler.
|
Control |
getControl()
Returns the ruler's SWT control.
|
Control |
getHeaderControl()
Returns this rulers header control.
|
int |
getLineOfLastMouseButtonActivity()
Returns the line number of the last mouse button activity.
|
IAnnotationModel |
getModel()
Returns the current annotation model of this ruler or
null
if the ruler has no model. |
int |
getWidth()
Returns the width of this ruler's control.
|
boolean |
hasAnnotation(int y)
Returns whether there is an annotation an the given vertical coordinate.
|
void |
removeAnnotationType(Object annotationType)
Removes the given annotation type from this overview ruler.
|
void |
removeHeaderAnnotationType(Object annotationType)
Removes the given annotation type from the header of this ruler.
|
void |
setAnnotationTypeColor(Object annotationType,
Color color)
Sets the color for the given annotation type in this overview ruler.
|
void |
setAnnotationTypeLayer(Object annotationType,
int layer)
Sets the drawing layer for the given annotation type in this overview ruler.
|
void |
setModel(IAnnotationModel model)
Associates an annotation model with this ruler.
|
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.
|
void |
update()
Forces the vertical ruler to synchronize itself with its
annotation model and its viewer's view port.
|
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors)
annotationAccess - the annotation accesswidth - the width of the vertical rulersharedColors - the color managerpublic Control getControl()
IVerticalRulerInfogetControl in interface IVerticalRulerInfopublic int getWidth()
IVerticalRulerInfogetWidth in interface IVerticalRulerInfopublic void setModel(IAnnotationModel model)
IVerticalRulernull is acceptable and clears the ruler.setModel in interface IVerticalRulermodel - the new annotation model, may be nullpublic Control createControl(Composite parent, ITextViewer textViewer)
IVerticalRulercreateControl in interface IVerticalRulerparent - the parent control of the ruler's controltextViewer - the text viewer to which this ruler belongspublic void update()
IVerticalRulerupdate in interface IVerticalRulerpublic void addAnnotationType(Object annotationType)
IOverviewRuleraddAnnotationType in interface IOverviewRulerannotationType - the annotation typepublic void removeAnnotationType(Object annotationType)
IOverviewRulerremoveAnnotationType in interface IOverviewRulerannotationType - the annotation typepublic void setAnnotationTypeLayer(Object annotationType, int layer)
IOverviewRulersetAnnotationTypeLayer in interface IOverviewRulerannotationType - the annotation typelayer - the drawing layerpublic void setAnnotationTypeColor(Object annotationType, Color color)
IOverviewRulersetAnnotationTypeColor in interface IOverviewRulerannotationType - the annotation typecolor - the colorpublic 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 IAnnotationModel getModel()
IVerticalRulernull
if the ruler has no model.getModel in interface IVerticalRulernull if there is no modelpublic int getAnnotationHeight()
IOverviewRulergetAnnotationHeight in interface IOverviewRulerpublic boolean hasAnnotation(int y)
IOverviewRulerhasAnnotation in interface IOverviewRulery - the y-coordinatetrue if there is an annotation, false otherwisepublic Control getHeaderControl()
IOverviewRulergetHeaderControl in interface IOverviewRulerpublic void addHeaderAnnotationType(Object annotationType)
IOverviewRuleraddHeaderAnnotationType in interface IOverviewRulerannotationType - the annotation type to be trackedpublic void removeHeaderAnnotationType(Object annotationType)
IOverviewRulerremoveHeaderAnnotationType in interface IOverviewRulerannotationType - the annotation type to be removedGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.