Package org.eclipse.jface.text.source
Class ChangeRulerColumn
java.lang.Object
org.eclipse.jface.text.source.ChangeRulerColumn
- All Implemented Interfaces:
IRevisionRulerColumn,IChangeRulerColumn,IVerticalRulerColumn,IVerticalRulerInfo,IVerticalRulerInfoExtension
public final class ChangeRulerColumn
extends Object
implements IChangeRulerColumn, IRevisionRulerColumn
A vertical ruler column displaying line numbers and serving as a UI for quick diff.
Clients instantiate and configure object of this class.
- Since:
- 3.0
-
Field Summary
Fields inherited from interface org.eclipse.jface.text.source.IChangeRulerColumn
QUICK_DIFF_MODEL_ID -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ChangeRulerColumn(ISharedTextColors sharedColors) Creates a new revision ruler column. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a vertical ruler listener to be informed if an annotation gets selected on the vertical ruler.createControl(CompositeRuler parentRuler, Composite parentControl) Creates the column's SWT control.Returns the column's SWT control.getHover()Returns the hover for this vertical ruler (column).intReturns the line number of the last mouse button activity.getModel()Returns the model currently used by the receiver.Returns the revision selection provider.protected intDeprecated.as of 3.2 the number of lines in the viewport cannot be computed because StyledText supports variable line heightsintgetWidth()Returns the width of this column's control.protected voidDisposes the column's resources.protected final booleanReturnstrueif the viewport displays the entire viewer contents, i.e. the viewer is not vertically scrollable.protected final voidTriggers a redraw in the display thread.voidredraw()Redraws this column.voidRemoves a previously registered listener.voidsetAddedColor(Color addedColor) Sets the background color for added lines.voidsetBackground(Color background) Sets the background color for normal lines.voidsetChangedColor(Color changedColor) Sets the background color for changed lines.voidsetDeletedColor(Color deletedColor) Sets the color for the deleted lines indicator.voidSets the font of this ruler column.voidsetHover(IAnnotationHover hover) Sets the hover of this ruler column.voidsetModel(IAnnotationModel model) Associates an annotation model with this ruler column.voidSets the revision information.inttoDocumentLineNumber(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.
-
Constructor Details
-
ChangeRulerColumn
Deprecated.since 3.2 useChangeRulerColumn(ISharedTextColors)insteadCreates a new ruler column.
-
-
Method Details
-
createControl
Description copied from interface:IVerticalRulerColumnCreates the column's SWT control.- Specified by:
createControlin interfaceIVerticalRulerColumn- Parameters:
parentRuler- the parent ruler of this columnparentControl- the control of the parent ruler- Returns:
- the column's SWT control
-
handleDispose
protected void handleDispose()Disposes the column's resources. -
getVisibleLinesInViewport
Deprecated.as of 3.2 the number of lines in the viewport cannot be computed because StyledText supports variable line heightsReturns the view port height in lines.- Returns:
- the view port height in lines
-
isViewerCompletelyShown
protected final boolean isViewerCompletelyShown()Returnstrueif the viewport displays the entire viewer contents, i.e. the viewer is not vertically scrollable.- Returns:
trueif the viewport displays the entire contents,falseotherwise- Since:
- 3.2
-
redraw
public void redraw()Description copied from interface:IVerticalRulerColumnRedraws this column.- Specified by:
redrawin interfaceIVerticalRulerColumn
-
setFont
Description copied from interface:IVerticalRulerColumnSets the font of this ruler column.- Specified by:
setFontin interfaceIVerticalRulerColumn- Parameters:
font- the new font of the ruler column
-
getLineOfLastMouseButtonActivity
public int getLineOfLastMouseButtonActivity()Description copied from interface:IVerticalRulerInfoReturns the line number of the last mouse button activity. Based on the input document of the connected text viewer.- Specified by:
getLineOfLastMouseButtonActivityin interfaceIVerticalRulerInfo- Returns:
- the line number of the last mouse button activity or
-1if the last mouse activity does not correspond to a valid document line
-
toDocumentLineNumber
public int toDocumentLineNumber(int y_coordinate) Description copied from interface:IVerticalRulerInfoTranslates a y-coordinate of the ruler's SWT control into the according line number of the document of the connected text viewer.- Specified by:
toDocumentLineNumberin interfaceIVerticalRulerInfo- Parameters:
y_coordinate- a y-coordinate of the ruler's SWT control- Returns:
- the line number of that coordinate or
-1if that coordinate does not correspond to a valid document line
-
getHover
Description copied from interface:IVerticalRulerInfoExtensionReturns the hover for this vertical ruler (column).- Specified by:
getHoverin interfaceIVerticalRulerInfoExtension- Returns:
- the hover for this column
-
setHover
Description copied from interface:IChangeRulerColumnSets the hover of this ruler column.- Specified by:
setHoverin interfaceIChangeRulerColumn- Parameters:
hover- the hover that will produce hover information text for this ruler column
-
setModel
Description copied from interface:IVerticalRulerColumnAssociates an annotation model with this ruler column. A valuenullis acceptable and clears the ruler.- Specified by:
setModelin interfaceIVerticalRulerColumn- Parameters:
model- the new annotation model, may benull
-
setBackground
Description copied from interface:IChangeRulerColumnSets the background color for normal lines. The color has to be disposed of by the caller when the receiver is no longer used.- Specified by:
setBackgroundin interfaceIChangeRulerColumn- Parameters:
background- the new color to be used as standard line background
-
setAddedColor
Description copied from interface:IChangeRulerColumnSets the background color for added lines. The color has to be disposed of by the caller when the receiver is no longer used.- Specified by:
setAddedColorin interfaceIChangeRulerColumn- Parameters:
addedColor- the new color to be used for the added lines background
-
setChangedColor
Description copied from interface:IChangeRulerColumnSets the background color for changed lines. The color has to be disposed of by the caller when the receiver is no longer used.- Specified by:
setChangedColorin interfaceIChangeRulerColumn- Parameters:
changedColor- the new color to be used for the changed lines background
-
setDeletedColor
Description copied from interface:IChangeRulerColumnSets the color for the deleted lines indicator. The color has to be disposed of by the caller when the receiver is no longer used.- Specified by:
setDeletedColorin interfaceIChangeRulerColumn- Parameters:
deletedColor- the new color to be used for the deleted lines indicator.
-
getModel
Description copied from interface:IVerticalRulerInfoExtensionReturns the model currently used by the receiver.- Specified by:
getModelin interfaceIVerticalRulerInfoExtension- Returns:
- the model of the receiver, or
nullif no model is installed.
-
getControl
Description copied from interface:IVerticalRulerColumnReturns the column's SWT control.- Specified by:
getControlin interfaceIVerticalRulerColumn- Specified by:
getControlin interfaceIVerticalRulerInfo- Returns:
- the column's SWT control
-
getWidth
public int getWidth()Description copied from interface:IVerticalRulerColumnReturns the width of this column's control.- Specified by:
getWidthin interfaceIVerticalRulerColumn- Specified by:
getWidthin interfaceIVerticalRulerInfo- Returns:
- the width of this column's control
-
postRedraw
protected final void postRedraw()Triggers a redraw in the display thread. -
addVerticalRulerListener
Description copied from interface:IVerticalRulerInfoExtensionRegisters a vertical ruler listener to be informed if an annotation gets selected on the vertical ruler.- Specified by:
addVerticalRulerListenerin interfaceIVerticalRulerInfoExtension- Parameters:
listener- the listener to be informed
-
removeVerticalRulerListener
Description copied from interface:IVerticalRulerInfoExtensionRemoves a previously registered listener. Iflisteneris not registered with the receiver, calling this method has no effect.- Specified by:
removeVerticalRulerListenerin interfaceIVerticalRulerInfoExtension- Parameters:
listener- the listener to be removed
-
setRevisionInformation
Description copied from interface:IRevisionRulerColumnSets the revision information.- Specified by:
setRevisionInformationin interfaceIRevisionRulerColumn- Parameters:
info- the new revision information, ornullto reset the ruler
-
getRevisionSelectionProvider
Returns the revision selection provider.- Returns:
- the revision selection provider
- Since:
- 3.2
-
ChangeRulerColumn(ISharedTextColors)instead