LPEX
3.6.8

com.ibm.lpex.alef
Class LpexRevisionPainter

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

public final class LpexRevisionPainter
extends Object

A strategy for painting the live annotate colors onto the vertical ruler column. It also manages the revision hover.


Constructor Summary
LpexRevisionPainter(IVerticalRulerColumn column, ISharedTextColors sharedColors)
          Creates a new revision painter for a vertical ruler column.
 
Method Summary
 void addRevisionListener(IRevisionListener listener)
          Adds a revision listener.
 IAnnotationHover getHover()
          Returns the revision hover.
 int getRequiredWidth()
          Returns the width in chars required to display information.
 ISelectionProvider getRevisionSelectionProvider()
          Returns the selection provider.
 boolean hasHover(int activeLine)
          Returns true if the receiver can provide a hover for a certain document line.
 boolean hasInformation()
          Returns true if a revision model has been set, false otherwise.
 void paint(GC gc)
          Delegates the painting of the quick diff colors to this painter.
 void removeRevisionListener(IRevisionListener listener)
          Removes a revision listener.
 void setBackground(Color background)
          Sets the background color.
 void setHover(IAnnotationHover hover)
          Sets the hover later returned by getHover().
 void setModel(IAnnotationModel model)
          Sets the annotation model.
 void setParentRuler(CompositeRuler parentRuler)
          Sets the parent ruler - the delegating column must call this method as soon as it creates its control.
 void setRenderingMode(RenderingMode renderingMode)
          Changes the rendering mode and triggers redrawing if needed.
 void setRevisionInformation(RevisionInformation info)
          Sets the revision information to be drawn and triggers a redraw.
 void showRevisionAuthor(boolean show)
          Enables showing the revision author.
 void showRevisionId(boolean show)
          Enables showing the revision id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexRevisionPainter

public LpexRevisionPainter(IVerticalRulerColumn column,
                           ISharedTextColors sharedColors)
Creates a new revision painter for a vertical ruler column.

Parameters:
column - the column that delegates paint(GC) to this newly created revision painter
sharedColors - a shared colors object to store shaded colors in
Method Detail

setRevisionInformation

public void setRevisionInformation(RevisionInformation info)
Sets the revision information to be drawn and triggers a redraw.

Parameters:
info - the revision information to show, null to draw none

setRenderingMode

public void setRenderingMode(RenderingMode renderingMode)
Changes the rendering mode and triggers redrawing if needed.

Parameters:
renderingMode - the rendering mode

setBackground

public void setBackground(Color background)
Sets the background color.

Parameters:
background - the background color, null for the platform's list background

setParentRuler

public void setParentRuler(CompositeRuler parentRuler)
Sets the parent ruler - the delegating column must call this method as soon as it creates its control.

Parameters:
parentRuler - the parent LpexCompositeRuler

paint

public void paint(GC gc)
Delegates the painting of the quick diff colors to this painter. The painter will draw the color boxes onto the passed GC for all visible model (document) lines.

Parameters:
gc - the GC to draw on

setModel

public void setModel(IAnnotationModel model)
Sets the annotation model.

Parameters:
model - the annotation model, possibly null
See Also:
IVerticalRulerColumn#setModel(IAnnotationModel)

getHover

public IAnnotationHover getHover()
Returns the revision hover.

Returns:
the revision hover

getRevisionSelectionProvider

public ISelectionProvider getRevisionSelectionProvider()
Returns the selection provider.

Returns:
the selection provider

setHover

public void setHover(IAnnotationHover hover)
Sets the hover later returned by getHover().

Parameters:
hover - the hover

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

hasInformation

public boolean hasInformation()
Returns true if a revision model has been set, false otherwise.

Returns:
true if a revision model has been set, false otherwise

getRequiredWidth

public int getRequiredWidth()
Returns the width in chars required to display information.

Returns:
the width in chars required to display information

showRevisionId

public void showRevisionId(boolean show)
Enables showing the revision id.

Parameters:
show - true to show the revision, false to hide it

showRevisionAuthor

public void showRevisionAuthor(boolean show)
Enables showing the revision author.

Parameters:
show - true to show the author, false to hide it

addRevisionListener

public void addRevisionListener(IRevisionListener listener)
Adds a revision listener.

Parameters:
listener - the listener

removeRevisionListener

public void removeRevisionListener(IRevisionListener listener)
Removes a revision listener.

Parameters:
listener - the listener

LPEX
3.6.8

Copyright © 2013 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.