|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 vertical ruler columns. Such
columns 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 column at the specified slot to this composite ruler. |
void |
addVerticalRulerListener(IVerticalRulerListener listener)
Registers a vertical ruler listener to be informed if an annotation gets selected on the vertical ruler. |
Control |
createControl(Composite parent,
ITextViewer textViewer)
Creates the ruler's SWT control. |
void |
fireAnnotationContextMenuAboutToShow(VerticalRulerEvent event,
Menu menu)
Informs all registered vertical ruler listeners that the content menu on a selected annotation\ is about to be shown. |
void |
fireAnnotationDefaultSelected(VerticalRulerEvent event)
Fires the annotation default selected event to all registered vertical ruler listeners. |
void |
fireAnnotationSelected(VerticalRulerEvent event)
Fires the annotation selected event to all registered vertical ruler listeners. |
Control |
getControl()
Returns the ruler's SWT control. |
Iterator |
getDecoratorIterator()
Returns an iterator over the IVerticalRulerColumns that make up this
composite column. |
IAnnotationHover |
getHover()
Returns the hover for this vertical ruler (column). |
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 |
removeDecorator(IVerticalRulerColumn rulerColumn)
Removes the given decorator from the composite ruler. |
void |
removeVerticalRulerListener(IVerticalRulerListener listener)
Removes a previously registered listener. |
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 view port. |
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 void removeDecorator(IVerticalRulerColumn rulerColumn)
rulerColumn
- the ruler column to be removedpublic Control getControl()
IVerticalRulerInfo
getControl
in interface IVerticalRulerInfo
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 setModel(IAnnotationModel model)
IVerticalRuler
null
is acceptable and clears the ruler.
setModel
in interface IVerticalRuler
model
- the new annotation model, may be null
public IAnnotationModel getModel()
IVerticalRuler
null
if the ruler has no model.
getModel
in interface IVerticalRuler
null
if there is no modelpublic void update()
IVerticalRuler
update
in interface IVerticalRuler
public void setFont(Font font)
IVerticalRulerExtension
setFont
in interface IVerticalRulerExtension
font
- the new font of the vertical rulerpublic int getWidth()
IVerticalRulerInfo
getWidth
in interface IVerticalRulerInfo
public 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 lineprotected static final int widgetLine2ModelLine(ITextViewer viewer, int widgetLine)
viewer
- the viewerwidgetLine
- the widget line
public ITextViewer getTextViewer()
public void setLocationOfLastMouseButtonActivity(int x, int y)
IVerticalRulerExtension
setLocationOfLastMouseButtonActivity
in interface IVerticalRulerExtension
x
- the x-coordinatey
- the y-coordinatepublic Iterator getDecoratorIterator()
IVerticalRulerColumns
that make up this
composite column.
public IAnnotationHover getHover()
IVerticalRulerInfoExtension
getHover
in interface IVerticalRulerInfoExtension
public void addVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtension
addVerticalRulerListener
in interface IVerticalRulerInfoExtension
listener
- the listener to be informedpublic void removeVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtension
listener
is not registered
with the receiver, calling this method has no effect.
removeVerticalRulerListener
in interface IVerticalRulerInfoExtension
listener
- the listener to be removedpublic void fireAnnotationSelected(VerticalRulerEvent event)
event
- the event to firepublic void fireAnnotationDefaultSelected(VerticalRulerEvent event)
event
- the event to firepublic void fireAnnotationContextMenuAboutToShow(VerticalRulerEvent event, Menu menu)
event
- the event to firemenu
- the menu that is about to be shown
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.