|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.source.OverviewRuler
Ruler presented next to a source viewer showing all annotations of the viewer's annotation model in a compact format. The ruler has the same height as the source viewer.
Clients usually instantiate and configure objects of this class.
Constructor Summary | |
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. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors)
annotationAccess
- the annotation accesswidth
- the width of the vertical rulersharedColors
- the color managerMethod Detail |
public Control getControl()
IVerticalRulerInfo
getControl
in interface IVerticalRulerInfo
public int getWidth()
IVerticalRulerInfo
getWidth
in interface IVerticalRulerInfo
public void setModel(IAnnotationModel model)
IVerticalRuler
null
is acceptable and clears the ruler.
setModel
in interface IVerticalRuler
model
- the new annotation model, may be null
public Control createControl(Composite parent, ITextViewer textViewer)
IVerticalRuler
createControl
in interface IVerticalRuler
parent
- the parent control of the ruler's controltextViewer
- the text viewer to which this ruler belongs
public void update()
IVerticalRuler
update
in interface IVerticalRuler
public void addAnnotationType(Object annotationType)
IOverviewRuler
addAnnotationType
in interface IOverviewRuler
annotationType
- the annotation typepublic void removeAnnotationType(Object annotationType)
IOverviewRuler
removeAnnotationType
in interface IOverviewRuler
annotationType
- the annotation typepublic void setAnnotationTypeLayer(Object annotationType, int layer)
IOverviewRuler
setAnnotationTypeLayer
in interface IOverviewRuler
annotationType
- the annotation typelayer
- the drawing layerpublic void setAnnotationTypeColor(Object annotationType, Color color)
IOverviewRuler
setAnnotationTypeColor
in interface IOverviewRuler
annotationType
- the annotation typecolor
- the colorpublic int getLineOfLastMouseButtonActivity()
IVerticalRulerInfo
0
.
getLineOfLastMouseButtonActivity
in interface IVerticalRulerInfo
public 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 IAnnotationModel getModel()
IVerticalRuler
null
if the ruler has no model.
getModel
in interface IVerticalRuler
null
if there is no modelpublic int getAnnotationHeight()
IOverviewRuler
getAnnotationHeight
in interface IOverviewRuler
public boolean hasAnnotation(int y)
IOverviewRuler
hasAnnotation
in interface IOverviewRuler
y
- the y-coordinate
true
if there is an annotation, false
otherwisepublic Control getHeaderControl()
IOverviewRuler
getHeaderControl
in interface IOverviewRuler
public void addHeaderAnnotationType(Object annotationType)
IOverviewRuler
addHeaderAnnotationType
in interface IOverviewRuler
annotationType
- the annotation type to be trackedpublic void removeHeaderAnnotationType(Object annotationType)
IOverviewRuler
removeHeaderAnnotationType
in interface IOverviewRuler
annotationType
- the annotation type to be removed
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.