|
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.LineNumberRulerColumn
org.eclipse.jface.text.source.LineNumberChangeRulerColumn
public final class LineNumberChangeRulerColumn
A vertical ruler column displaying line numbers and serving as a UI for quick diff. Clients usually instantiate and configure object of this class.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jface.text.source.IChangeRulerColumn |
|---|
QUICK_DIFF_MODEL_ID |
| Constructor Summary | |
|---|---|
LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addVerticalRulerListener(IVerticalRulerListener listener)
Registers a vertical ruler listener to be informed if an annotation gets selected on the vertical ruler. |
protected int |
computeNumberOfDigits()
Does the real computation of the number of digits. |
protected java.lang.String |
createDisplayString(int line)
Computes the string to be printed for line. |
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 model currently used by the receiver. |
protected void |
handleDispose()
Disposes the column's resources. |
protected void |
paintLine(int line,
int y,
int lineheight,
GC gc,
Display display)
Paints the line. |
void |
removeVerticalRulerListener(IVerticalRulerListener listener)
Removes a previously registered listener. |
void |
setAddedColor(Color addedColor)
Sets the background color for added lines. |
void |
setChangedColor(Color changedColor)
Sets the background color for changed lines. |
void |
setDeletedColor(Color deletedColor)
Sets the color for the deleted lines indicator. |
void |
setDisplayMode(boolean characterMode)
Sets the the display mode of the ruler. |
void |
setHover(IAnnotationHover hover)
Sets the hover of this ruler column. |
void |
setModel(IAnnotationModel model)
Associates an annotation model with this ruler column. |
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. |
| Methods inherited from class org.eclipse.jface.text.source.LineNumberRulerColumn |
|---|
computeIndentations, createControl, getBackground, getControl, getForeground, getParentRuler, getVisibleLinesInViewport, getWidth, layout, postRedraw, redraw, setBackground, setFont, setForeground, updateNumberOfDigits |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.text.source.IVerticalRulerInfo |
|---|
getControl, getWidth |
| Methods inherited from interface org.eclipse.jface.text.source.IChangeRulerColumn |
|---|
setBackground |
| Methods inherited from interface org.eclipse.jface.text.source.IVerticalRulerColumn |
|---|
createControl, getControl, getWidth, redraw, setFont |
| Constructor Detail |
|---|
public LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
sharedColors - the shared colors provider to use| Method Detail |
|---|
protected void handleDispose()
LineNumberRulerColumn
handleDispose in class LineNumberRulerColumn
protected void paintLine(int line,
int y,
int lineheight,
GC gc,
Display display)
LineNumberRulerColumnThis default implementation does nothing.
paintLine in class LineNumberRulerColumnline - the line of the document which the ruler is painted fory - the y-coordinate of the box being painted for line, relative to gclineheight - the height of one line (and therefore of the box being painted)gc - the drawing context the client may choose to draw on.display - the display the drawing occurs onpublic int getLineOfLastMouseButtonActivity()
IVerticalRulerInfo0.
getLineOfLastMouseButtonActivity in interface IVerticalRulerInfopublic 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 IAnnotationHover getHover()
IVerticalRulerInfoExtension
getHover in interface IVerticalRulerInfoExtensionpublic void setHover(IAnnotationHover hover)
setHover in interface IChangeRulerColumnhover - the hover that will produce hover information text for this ruler columnpublic void setModel(IAnnotationModel model)
IVerticalRulerColumnnull is acceptable and clears the ruler.
setModel in interface IVerticalRulerColumnsetModel in class LineNumberRulerColumnmodel - the new annotation model, may be nullpublic void setAddedColor(Color addedColor)
setAddedColor in interface IChangeRulerColumnaddedColor - the new color to be used for the added lines backgroundpublic void setChangedColor(Color changedColor)
setChangedColor in interface IChangeRulerColumnchangedColor - the new color to be used for the changed lines backgroundpublic void setDeletedColor(Color deletedColor)
setDeletedColor in interface IChangeRulerColumndeletedColor - the new color to be used for the deleted lines indicator.public void setDisplayMode(boolean characterMode)
true, diff
information will be displayed textually on the line number ruler.
characterMode - true if diff information is to be displayed textually.public IAnnotationModel getModel()
IVerticalRulerInfoExtension
getModel in interface IVerticalRulerInfoExtensionnull if no model is
installed.protected java.lang.String createDisplayString(int line)
LineNumberRulerColumnline. The default implementation returns
Integer.toString(line + 1).
createDisplayString in class LineNumberRulerColumnline - the line number for which the line number string is generated
lineprotected int computeNumberOfDigits()
LineNumberRulerColumn
computeNumberOfDigits in class LineNumberRulerColumnpublic void addVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtension
addVerticalRulerListener in interface IVerticalRulerInfoExtensionlistener - the listener to be informedpublic void removeVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtensionlistener is not registered
with the receiver, calling this method has no effect.
removeVerticalRulerListener in interface IVerticalRulerInfoExtensionlistener - the listener to be removed
|
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.