|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.text.source.CompositeRuler
Standard implementation of IVerticalRuler
. This ruler does not have a
a visual representation of its own. The presentation comes from the configurable list
of decorators. Decorators must implement the IVerticalRulerColumn
interface.
Clients may instantiate and configure this class.
IVerticalRulerColumn
,
ITextViewer
Constructor Summary | |
CompositeRuler()
Constructs a new composite vertical ruler. |
|
CompositeRuler(int gap)
Constructs a new composite ruler with the given gap between its columns. |
Method Summary | |
void |
addDecorator(int index,
IVerticalRulerColumn rulerColumn)
Inserts the given decorator at the specfied slot to this composite ruler. |
Control |
createControl(Composite parent,
ITextViewer textViewer)
Creates the ruler's SWT control. |
Control |
getControl()
Returns the ruler's SWT 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. |
ITextViewer |
getTextViewer()
Returns this ruler's text viewer. |
int |
getWidth()
Returns the width of this ruler's control. |
void |
removeDecorator(int index)
Removes the decorator in the specified slot from this composite ruler. |
void |
setFont(Font font)
Sets the font of this vertical ruler. |
void |
setLocationOfLastMouseButtonActivity(int x,
int y)
Sets the location of the last mouse button activity. |
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 viewport. |
protected static int |
widgetLine2ModelLine(ITextViewer viewer,
int widgetLine)
Returns the line in the given viewer's document that correspond to the given line of the viewer's widget. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CompositeRuler()
public CompositeRuler(int gap)
gap
- Method Detail |
public void addDecorator(int index, IVerticalRulerColumn rulerColumn)
index
- the indexrulerColumn
- the decorator to be insertedpublic void removeDecorator(int index)
index
- the indexpublic Control getControl()
IVerticalRulerInfo
getControl
in interface IVerticalRulerInfo
org.eclipse.jface.text.source.IVerticalRulerInfo
public Control createControl(Composite parent, ITextViewer textViewer)
IVerticalRuler
createControl
in interface IVerticalRuler
org.eclipse.jface.text.source.IVerticalRuler
parent
- the parent control of the ruler's controltextViewer
- the text viewer to which this ruler belongspublic void setModel(IAnnotationModel model)
IVerticalRuler
null
is acceptable and clears the ruler.setModel
in interface IVerticalRuler
org.eclipse.jface.text.source.IVerticalRuler
model
- the new annotation model, may be null
public IAnnotationModel getModel()
IVerticalRuler
null
if the ruler has no model.getModel
in interface IVerticalRuler
org.eclipse.jface.text.source.IVerticalRuler
null
if there is no modelpublic void update()
IVerticalRuler
update
in interface IVerticalRuler
public void setFont(Font font)
IVerticalRulerExtension
setFont
in interface IVerticalRulerExtension
org.eclipse.jface.text.source.IVerticalRulerExtension
font
- the new font of the vertical rulerpublic int getWidth()
IVerticalRulerInfo
getWidth
in interface IVerticalRulerInfo
org.eclipse.jface.text.source.IVerticalRulerInfo
public int getLineOfLastMouseButtonActivity()
IVerticalRulerInfo
getLineOfLastMouseButtonActivity
in interface IVerticalRulerInfo
org.eclipse.jface.text.source.IVerticalRulerInfo
public int toDocumentLineNumber(int y_coordinate)
IVerticalRulerInfo
toDocumentLineNumber
in interface IVerticalRulerInfo
org.eclipse.jface.text.source.IVerticalRulerInfo
y_coordinate
- a y-coordinate of the ruler's SWT control-1
if that
coordinate does not correspond to a valid document lineprotected static final int widgetLine2ModelLine(ITextViewer viewer, int widgetLine)
viewer
- the viewerwidgetLine
- the widget linepublic ITextViewer getTextViewer()
public void setLocationOfLastMouseButtonActivity(int x, int y)
IVerticalRulerExtension
setLocationOfLastMouseButtonActivity
in interface IVerticalRulerExtension
org.eclipse.jface.text.source.IVerticalRulerExtension
x
- the x-coordinatey
- the y-coordinate
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |