public class LineNumberChangeRulerColumn extends LineNumberRulerColumn implements IChangeRulerColumn, IRevisionRulerColumn, IRevisionRulerColumnExtension
IRevisionRulerColumnExtension.RenderingModeQUICK_DIFF_MODEL_IDAGE, AUTHOR, AUTHOR_SHADED_BY_AGE| Constructor and Description |
|---|
LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRevisionListener(IRevisionListener listener)
Adds a revision listener that will be notified when the displayed revision information
changes.
|
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.
|
int |
getWidth()
Returns the width of this column's control.
|
protected void |
handleDispose()
Disposes the column's resources.
|
boolean |
isShowingChangeInformation()
Returns
true if the ruler is showing change information, false
otherwise |
boolean |
isShowingLineNumbers()
Returns
true if the ruler is showing line numbers, false
otherwise |
boolean |
isShowingRevisionInformation()
Returns
true if the ruler is showing revision information, false
otherwise |
void |
removeRevisionListener(IRevisionListener listener)
Removes a previously registered revision listener; nothing happens if
listener
was not registered with the receiver. |
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.
|
void |
setRevisionRenderingMode(IRevisionRulerColumnExtension.RenderingMode renderingMode)
Changes the rendering mode and triggers redrawing if needed.
|
void |
showLineNumbers(boolean showNumbers)
Sets the line number display mode.
|
void |
showRevisionAuthor(boolean show)
Enables showing the revision author.
|
void |
showRevisionId(boolean show)
Enables showing the revision id.
|
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, isViewerCompletelyShown, layout, paintLine, postRedraw, redraw, setFont, setForeground, updateNumberOfDigitsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetControl, redraw, setFontgetControlpublic LineNumberChangeRulerColumn(ISharedTextColors sharedColors)
sharedColors - the shared colors provider to usepublic Control createControl(CompositeRuler parentRuler, Composite parentControl)
IVerticalRulerColumncreateControl in interface IVerticalRulerColumncreateControl in class LineNumberRulerColumnparentRuler - the parent ruler of this columnparentControl - the control of the parent rulerpublic int getLineOfLastMouseButtonActivity()
IVerticalRulerInfogetLineOfLastMouseButtonActivity in interface IVerticalRulerInfo-1 if
the last mouse activity does not correspond to a valid document linepublic int toDocumentLineNumber(int y_coordinate)
IVerticalRulerInfotoDocumentLineNumber 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 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 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()
IVerticalRulerInfoExtensiongetModel in interface IVerticalRulerInfoExtensionnull if no model is
installed.protected 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 generatedlineprotected int computeNumberOfDigits()
LineNumberRulerColumncomputeNumberOfDigits in class LineNumberRulerColumnpublic void addVerticalRulerListener(IVerticalRulerListener listener)
IVerticalRulerInfoExtensionaddVerticalRulerListener 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 removedpublic IAnnotationHover getHover()
IVerticalRulerInfoExtensiongetHover in interface IVerticalRulerInfoExtensionpublic void setHover(IAnnotationHover hover)
IChangeRulerColumnsetHover in interface IChangeRulerColumnhover - the hover that will produce hover information text for this ruler columnpublic void setBackground(Color background)
LineNumberRulerColumnsetBackground in interface IChangeRulerColumnsetBackground in class LineNumberRulerColumnbackground - the background colorpublic void setAddedColor(Color addedColor)
IChangeRulerColumnsetAddedColor in interface IChangeRulerColumnaddedColor - the new color to be used for the added lines backgroundpublic void setChangedColor(Color changedColor)
IChangeRulerColumnsetChangedColor in interface IChangeRulerColumnchangedColor - the new color to be used for the changed lines backgroundpublic void setDeletedColor(Color deletedColor)
IChangeRulerColumnsetDeletedColor in interface IChangeRulerColumndeletedColor - the new color to be used for the deleted lines indicator.public void setRevisionInformation(RevisionInformation info)
IRevisionRulerColumnsetRevisionInformation in interface IRevisionRulerColumninfo - the new revision information, or null to reset the rulerpublic ISelectionProvider getRevisionSelectionProvider()
IRevisionRulerColumnExtensiongetRevisionSelectionProvider in interface IRevisionRulerColumnExtensionpublic void setRevisionRenderingMode(IRevisionRulerColumnExtension.RenderingMode renderingMode)
IRevisionRulerColumnExtensionsetRevisionRenderingMode in interface IRevisionRulerColumnExtensionrenderingMode - the rendering modepublic void showLineNumbers(boolean showNumbers)
showNumbers - true to show numbers, false to only show
diff / revision info.public int getWidth()
IVerticalRulerColumngetWidth in interface IVerticalRulerColumngetWidth in interface IVerticalRulerInfogetWidth in class LineNumberRulerColumnpublic boolean isShowingLineNumbers()
true if the ruler is showing line numbers, false
otherwisetrue if line numbers are shown, false otherwisepublic boolean isShowingRevisionInformation()
true if the ruler is showing revision information, false
otherwisetrue if revision information is shown, false otherwisepublic boolean isShowingChangeInformation()
true if the ruler is showing change information, false
otherwisetrue if change information is shown, false otherwisepublic void showRevisionAuthor(boolean show)
IRevisionRulerColumnExtensionshowRevisionAuthor in interface IRevisionRulerColumnExtensionshow - true to show the author, false to hide itpublic void showRevisionId(boolean show)
IRevisionRulerColumnExtensionshowRevisionId in interface IRevisionRulerColumnExtensionshow - true to show the revision, false to hide itpublic void addRevisionListener(IRevisionListener listener)
IRevisionRulerColumnExtensionaddRevisionListener in interface IRevisionRulerColumnExtensionlistener - the listener to addpublic void removeRevisionListener(IRevisionListener listener)
IRevisionRulerColumnExtensionlistener
was not registered with the receiver.removeRevisionListener in interface IRevisionRulerColumnExtensionlistener - the listener to removeprotected void handleDispose()
LineNumberRulerColumnhandleDispose in class LineNumberRulerColumn
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.