|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.lpex.alef.LpexVerticalRuler
A vertical ruler which is connected to an LpexTextViewer.
This is a single-column standard implementation of IVerticalRuler
for LPEX. The same can be achieved by using a CompositeRuler
configured with an AnnotationRulerColumn
.
Eclipse's org.eclipse.jface.text.source.VerticalRuler assumes StyledText as the viewer's text widget. LPEX currently uses its own text widget.
ITextViewer
Constructor Summary | |
---|---|
LpexVerticalRuler(int width)
Constructs a vertical ruler with the given width. |
|
LpexVerticalRuler(int width,
IAnnotationAccess annotationAcccess)
Constructs a vertical ruler with the given width and the given annotation access. |
Method Summary | |
---|---|
void |
addMouseListener(MouseListener listener)
Deprecated. will be removed (as per Eclipse's VerticalRuler). |
Control |
createControl(Composite parent,
ITextViewer textViewer)
Create the vertical ruler's SWT control, a Canvas, for the LpexTextViewer specified. |
protected void |
doPaint(GC gc)
Draws the vertical ruler annotations (without drawing the Canvas background). |
Control |
getControl()
Return the vertical ruler's SWT control, if any was created yet. |
int |
getLineOfLastMouseButtonActivity()
Return the document line number in LpexTextViewer corresponding to the last mouse-button activity inside the ruler. |
IAnnotationModel |
getModel()
Return 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. |
void |
removeMouseListener(MouseListener listener)
Deprecated. will be removed (as per Eclipse's VerticalRuler). |
void |
setFont(Font font)
Set the font of this vertical ruler. |
void |
setLocationOfLastMouseButtonActivity(int x,
int y)
Set the location of the last mouse button activity. |
void |
setModel(IAnnotationModel model)
Associate an annotation model with this vertical ruler. |
int |
toDocumentLineNumber(int y_coordinate)
Translates a y-coordinate of the vertical ruler's SWT Control into the corresponding ZERO-based line number of the input document section of the connected LpexTextViewer. |
void |
update()
Force the vertical ruler to update. |
protected static int |
widgetLine2ModelLine(LpexTextViewer viewer,
int widgetRow)
Returns the line of the viewer's document that corresponds to the given row number in the LPEX text widget edit area. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LpexVerticalRuler(int width)
width
- the width of the vertical rulerpublic LpexVerticalRuler(int width, IAnnotationAccess annotationAcccess)
width
- the width of the vertical rulerannotationAcccess
- the annotation accessMethod Detail |
public Control getControl()
getControl
in interface IVerticalRulerInfo
IVerticalRulerInfo.getControl()
public Control createControl(Composite parent, ITextViewer textViewer)
createControl
in interface IVerticalRuler
textViewer
- the LpexTextViewer associated with this rulerIVerticalRuler.createControl(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.ITextViewer)
protected void doPaint(GC gc)
gc
- the GC to draw onpublic void update()
update
in interface IVerticalRuler
IVerticalRuler.update()
public void setModel(IAnnotationModel model)
null
value clears the ruler.
setModel
in interface IVerticalRuler
IVerticalRuler.setModel(org.eclipse.jface.text.source.IAnnotationModel)
public IAnnotationModel getModel()
null
if the ruler has no model.
getModel
in interface IVerticalRuler
IVerticalRuler.getModel()
public int getWidth()
getWidth
in interface IVerticalRulerInfo
IVerticalRulerInfo.getWidth()
public int getLineOfLastMouseButtonActivity()
getLineOfLastMouseButtonActivity
in interface IVerticalRulerInfo
IVerticalRulerInfo.getLineOfLastMouseButtonActivity()
public int toDocumentLineNumber(int y_coordinate)
toDocumentLineNumber
in interface IVerticalRulerInfo
IVerticalRulerInfo.toDocumentLineNumber(int)
protected static final int widgetLine2ModelLine(LpexTextViewer viewer, int widgetRow)
viewer
- the LpexTextViewerwidgetRow
- the row in the LPEX text widget edit area
-1
if the given row is beyond the number of rows in the edit area,
or doesn't correspond to a document line (it's a show line, an expand /
hide header, or is beyond the elements actually displayed in the edit area)public void setFont(Font font)
setFont
in interface IVerticalRulerExtension
IVerticalRulerExtension.setFont(org.eclipse.swt.graphics.Font)
public void setLocationOfLastMouseButtonActivity(int x, int y)
setLocationOfLastMouseButtonActivity
in interface IVerticalRulerExtension
IVerticalRulerExtension.setLocationOfLastMouseButtonActivity(int, int)
public void addMouseListener(MouseListener listener)
listener
- the listener to be addedpublic void removeMouseListener(MouseListener listener)
listener
- the listener to be removed
|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |