|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.text.source.OverviewRuler
public class 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. |
|
OverviewRuler(IAnnotationAccess annotationAccess,
int width,
ISharedTextColors sharedColors,
boolean discolorTemporaryAnnotation)
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)
Note: As of 3.4, temporary annotations are no longer discolored.
Use OverviewRuler(IAnnotationAccess, int, ISharedTextColors, boolean) if you
want to keep the old behavior.
annotationAccess - the annotation accesswidth - the width of the vertical rulersharedColors - the color manager
public OverviewRuler(IAnnotationAccess annotationAccess,
int width,
ISharedTextColors sharedColors,
boolean discolorTemporaryAnnotation)
annotationAccess - the annotation accesswidth - the width of the vertical rulersharedColors - the color managerdiscolorTemporaryAnnotation - true if temporary annotations should be discolored| Method Detail |
|---|
public Control getControl()
IVerticalRulerInfo
getControl in interface IVerticalRulerInfopublic int getWidth()
IVerticalRulerInfo
getWidth in interface IVerticalRulerInfopublic void setModel(IAnnotationModel model)
IVerticalRulernull is acceptable and clears the ruler.
setModel in interface IVerticalRulermodel - the new annotation model, may be null
public Control createControl(Composite parent,
ITextViewer textViewer)
IVerticalRuler
createControl in interface IVerticalRulerparent - the parent control of the ruler's controltextViewer - the text viewer to which this ruler belongs
public void update()
IVerticalRuler
update in interface IVerticalRulerpublic void addAnnotationType(Object annotationType)
IOverviewRuler
addAnnotationType in interface IOverviewRulerannotationType - the annotation typepublic void removeAnnotationType(Object annotationType)
IOverviewRuler
removeAnnotationType in interface IOverviewRulerannotationType - the annotation type
public void setAnnotationTypeLayer(Object annotationType,
int layer)
IOverviewRuler
setAnnotationTypeLayer in interface IOverviewRulerannotationType - the annotation typelayer - the drawing layer
public void setAnnotationTypeColor(Object annotationType,
Color color)
IOverviewRuler
setAnnotationTypeColor in interface IOverviewRulerannotationType - the annotation typecolor - the colorpublic 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 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()
IOverviewRuler
getAnnotationHeight in interface IOverviewRulerpublic boolean hasAnnotation(int y)
IOverviewRuler
hasAnnotation in interface IOverviewRulery - the y-coordinate
true if there is an annotation, false otherwisepublic Control getHeaderControl()
IOverviewRuler
getHeaderControl in interface IOverviewRulerpublic void addHeaderAnnotationType(Object annotationType)
IOverviewRuler
addHeaderAnnotationType in interface IOverviewRulerannotationType - the annotation type to be trackedpublic void removeHeaderAnnotationType(Object annotationType)
IOverviewRuler
removeHeaderAnnotationType in interface IOverviewRulerannotationType - the annotation type to be removed
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.