LPEX
4.4.0

com.ibm.lpex.alef
Class LpexLineNumberChangeRulerColumn

java.lang.Object
  extended by com.ibm.lpex.alef.LpexLineNumberChangeRulerColumn

public final class LpexLineNumberChangeRulerColumn
extends Object

A vertical ruler column for quick diff and revisions. Despite its name (after Eclipse's corresponding class), line numbers are not supported in this ruler. In LPEX, the prefix area is used to display line and sequence numbers.

Clients usually instantiate and configure objects of this class.

Eclipse's org.eclipse.jface.text.source.LineNumberChangeRulerColumn assumes StyledText as the viewer's text widget. LPEX currently uses its own text widget.


Constructor Summary
LpexLineNumberChangeRulerColumn(ISharedTextColors sharedColors)
          Creates a new instance.
 
Method Summary
 void addRevisionListener(IRevisionListener listener)
           
 void addVerticalRulerListener(IVerticalRulerListener listener)
           
protected  int computeNumberOfDigits()
           
 Control createControl(CompositeRuler parentRuler, Composite parentControl)
          Creates the ruler column's SWT control, a Canvas, for the LpexCompositeRuler specified.
protected  Color getBackground(Display display)
          Returns the System background color used for list widgets.
 Control getControl()
           
protected  String getDisplayCharacter(int line)
          Returns the accessibility quick-diff display character for a certain model line.
 IAnnotationHover getHover()
           
 int getLineOfLastMouseButtonActivity()
           
 IAnnotationModel getModel()
           
 ISelectionProvider getRevisionSelectionProvider()
           
 int getWidth()
           
protected  void handleDispose()
          Disposes this ruler column's resources.
 boolean hasHover(int activeLine)
          Returns true if the receiver can provide a hover for a certain document line.
 boolean isShowingChangeInformation()
          Returns whether the ruler is showing diff information.
 boolean isShowingRevisionInformation()
          Returns whether the ruler is showing revision information.
protected  void layout()
          Lays out the enclosing viewer to adapt the layout to changes of the size of the individual components.
protected  void paintLine(int line, int y, int lineheight, int width, GC gc, Color deletionColor)
           
protected  void postRedraw()
          Triggers a redraw of this entire column in the display thread.
 void redraw()
          Redraws this entire ruler column (quick diff, revisions).
 void removeRevisionListener(IRevisionListener listener)
           
 void removeVerticalRulerListener(IVerticalRulerListener listener)
           
 void setAddedColor(Color addedColor)
           
 void setBackground(Color background)
           
 void setChangedColor(Color changedColor)
           
 void setDeletedColor(Color deletedColor)
           
 void setDisplayMode(boolean characterMode)
          Sets the display mode of the ruler for the quick-diff display.
 void setFont(Font font)
           
 void setHover(IAnnotationHover hover)
           
 void setModel(IAnnotationModel model)
          Associates an annotation model with this ruler column.
 void setRevisionInformation(RevisionInformation info)
           
 void setRevisionRenderingMode(RenderingMode renderingMode)
           
 void showRevisionAuthor(boolean show)
           
 void showRevisionId(boolean show)
           
 int toDocumentLineNumber(int y_coordinate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexLineNumberChangeRulerColumn

public LpexLineNumberChangeRulerColumn(ISharedTextColors sharedColors)
Creates a new instance.

Parameters:
sharedColors - the shared colors provider to use
Method Detail

createControl

public Control createControl(CompositeRuler parentRuler,
                             Composite parentControl)
Creates the ruler column's SWT control, a Canvas, for the LpexCompositeRuler specified.

Parameters:
parentRuler - the parent LpexCompositeRuler associated with this ruler column
parentControl - the control of the parent ruler
See Also:
IVerticalRulerColumn

getLineOfLastMouseButtonActivity

public int getLineOfLastMouseButtonActivity()

toDocumentLineNumber

public int toDocumentLineNumber(int y_coordinate)

setModel

public void setModel(IAnnotationModel model)
Associates an annotation model with this ruler column. A null value clears the ruler.

Parameters:
model - the annotation model, possibly null
See Also:
IVerticalRulerColumn

setDisplayMode

public void setDisplayMode(boolean characterMode)
Sets the display mode of the ruler for the quick-diff display. When character mode is set to true, quick diff information will be displayed textually on the line number ruler.

Parameters:
characterMode - true if diff information is to be displayed textually

getModel

public IAnnotationModel getModel()

addVerticalRulerListener

public void addVerticalRulerListener(IVerticalRulerListener listener)

removeVerticalRulerListener

public void removeVerticalRulerListener(IVerticalRulerListener listener)

getHover

public IAnnotationHover getHover()

hasHover

public boolean hasHover(int activeLine)
Returns true if the receiver can provide a hover for a certain document line.

Parameters:
activeLine - the document line of interest
Returns:
true if the receiver can provide a hover

setHover

public void setHover(IAnnotationHover hover)

setBackground

public void setBackground(Color background)

setAddedColor

public void setAddedColor(Color addedColor)

setChangedColor

public void setChangedColor(Color changedColor)

setDeletedColor

public void setDeletedColor(Color deletedColor)

setRevisionInformation

public void setRevisionInformation(RevisionInformation info)

getRevisionSelectionProvider

public ISelectionProvider getRevisionSelectionProvider()

setRevisionRenderingMode

public void setRevisionRenderingMode(RenderingMode renderingMode)

computeNumberOfDigits

protected int computeNumberOfDigits()

getWidth

public int getWidth()

layout

protected void layout()
Lays out the enclosing viewer to adapt the layout to changes of the size of the individual components.


isShowingRevisionInformation

public boolean isShowingRevisionInformation()
Returns whether the ruler is showing revision information.

Returns:
true if revision information is shown, false otherwise

isShowingChangeInformation

public boolean isShowingChangeInformation()
Returns whether the ruler is showing diff information.

Returns:
true if change information is shown, false otherwise

showRevisionAuthor

public void showRevisionAuthor(boolean show)

showRevisionId

public void showRevisionId(boolean show)

addRevisionListener

public void addRevisionListener(IRevisionListener listener)

removeRevisionListener

public void removeRevisionListener(IRevisionListener listener)

getDisplayCharacter

protected String getDisplayCharacter(int line)
Returns the accessibility quick-diff display character for a certain model line.

Parameters:
line - the document line of interest
Returns:
the display character for line

handleDispose

protected void handleDispose()
Disposes this ruler column's resources.


redraw

public void redraw()
Redraws this entire ruler column (quick diff, revisions).

See Also:
IVerticalRulerColumn

setFont

public void setFont(Font font)

paintLine

protected void paintLine(int line,
                         int y,
                         int lineheight,
                         int width,
                         GC gc,
                         Color deletionColor)
Parameters:
line - the line of the document for which the ruler column is painted
y - the y-coordinate of the box being painted for line, relative to gc
lineheight - the height of one line (i.e., of the box being painted)
width - the width of the column
gc - the drawing context the client may choose to draw on
deletionColor - the color for deletion line indicators

getBackground

protected Color getBackground(Display display)
Returns the System background color used for list widgets.

Parameters:
display - the display
Returns:
the System background color for list widgets

getControl

public Control getControl()

postRedraw

protected final void postRedraw()
Triggers a redraw of this entire column in the display thread. May be called from any thread.


LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.