public final class LineNumberChangeRulerColumn extends LineNumberRulerColumn implements IVerticalRulerInfo, IVerticalRulerInfoExtension, IChangeRulerColumn, IRevisionRulerColumn
QUICK_DIFF_MODEL_ID
Constructor and Description |
---|
LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Control |
createControl(CompositeRuler parentRuler,
Composite parentControl)
Creates the column's SWT control.
|
protected 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.
|
ISelectionProvider |
getRevisionSelectionProvider()
Returns the revision selection provider.
|
void |
removeVerticalRulerListener(IVerticalRulerListener listener)
Removes a previously registered listener.
|
void |
setAddedColor(Color addedColor)
Sets the background color for added lines.
|
void |
setBackground(Color background)
Sets the background color of this column.
|
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 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.
|
void |
setRevisionInformation(RevisionInformation info)
Sets the revision information.
|
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.
|
computeIndentations, getBackground, getControl, getForeground, getParentRuler, getVisibleLinesInViewport, getWidth, handleDispose, isViewerCompletelyShown, layout, paintLine, postRedraw, redraw, setFont, setForeground, updateNumberOfDigits
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getControl, getWidth, redraw, setFont
getControl, getWidth
public LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
sharedColors
- the shared colors provider to usepublic Control createControl(CompositeRuler parentRuler, Composite parentControl)
IVerticalRulerColumn
createControl
in interface IVerticalRulerColumn
createControl
in class LineNumberRulerColumn
parentRuler
- the parent ruler of this columnparentControl
- the control of the parent rulerpublic 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 linepublic void setModel(IAnnotationModel model)
IVerticalRulerColumn
null
is acceptable and clears the ruler.setModel
in interface IVerticalRulerColumn
setModel
in class LineNumberRulerColumn
model
- the new annotation model, may be null
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 IVerticalRulerInfoExtension
null
if no model is
installed.protected String createDisplayString(int line)
LineNumberRulerColumn
line
. The default implementation returns
Integer.toString(line + 1)
.createDisplayString
in class LineNumberRulerColumn
line
- the line number for which the line number string is generatedline
protected int computeNumberOfDigits()
LineNumberRulerColumn
computeNumberOfDigits
in class LineNumberRulerColumn
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 IAnnotationHover getHover()
IVerticalRulerInfoExtension
getHover
in interface IVerticalRulerInfoExtension
public void setHover(IAnnotationHover hover)
IChangeRulerColumn
setHover
in interface IChangeRulerColumn
hover
- the hover that will produce hover information text for this ruler columnpublic void setBackground(Color background)
LineNumberRulerColumn
setBackground
in interface IChangeRulerColumn
setBackground
in class LineNumberRulerColumn
background
- the background colorpublic void setAddedColor(Color addedColor)
IChangeRulerColumn
setAddedColor
in interface IChangeRulerColumn
addedColor
- the new color to be used for the added lines backgroundpublic void setChangedColor(Color changedColor)
IChangeRulerColumn
setChangedColor
in interface IChangeRulerColumn
changedColor
- the new color to be used for the changed lines backgroundpublic void setDeletedColor(Color deletedColor)
IChangeRulerColumn
setDeletedColor
in interface IChangeRulerColumn
deletedColor
- the new color to be used for the deleted lines indicator.public void setRevisionInformation(RevisionInformation info)
IRevisionRulerColumn
setRevisionInformation
in interface IRevisionRulerColumn
info
- the new revision information, or null
to reset the rulerpublic ISelectionProvider getRevisionSelectionProvider()
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.