LPEX
4.4.0

com.ibm.lpex.alef
Class LpexOverviewRuler

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

public class LpexOverviewRuler
extends Object

A vertical ruler displayed next to an LpexSourceViewer showing all annotations of the viewer's annotation model in a compact format. The ruler has the same height as the source viewer. Clients usually instantiate and configure objects of this class.

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


Constructor Summary
LpexOverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors)
          Constructs a overview ruler of the given width using the given annotation access and color manager.
LpexOverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors, boolean discolorTemporaryAnnotation)
          Constructs a overview ruler of the given width using the given annotation access and color manager.
 
Method Summary
 void addAnnotationType(Object annotationType)
           
 void addHeaderAnnotationType(Object annotationType)
           
 Control createControl(Composite parent, ITextViewer textViewer)
          Creates the overview ruler's SWT control, a Canvas, for the LpexTextViewer specified.
 int getAnnotationHeight()
           
 Control getControl()
           
 Control getHeaderControl()
           
 int getLineOfLastMouseButtonActivity()
           
 IAnnotationModel getModel()
           
 int getWidth()
           
 boolean hasAnnotation(int y)
           
 void removeAnnotationType(Object annotationType)
           
 void removeHeaderAnnotationType(Object annotationType)
           
 void setAnnotationTypeColor(Object annotationType, Color color)
           
 void setAnnotationTypeLayer(Object annotationType, int layer)
           
 void setModel(IAnnotationModel model)
          Associates an annotation model with this overview ruler.
 void setUseSaturatedColors(boolean useSaturatedColor)
           
 int toDocumentLineNumber(int y_coordinate)
           
 void update()
          Forces the overview ruler to update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexOverviewRuler

public LpexOverviewRuler(IAnnotationAccess annotationAccess,
                         int width,
                         ISharedTextColors sharedColors)
Constructs a overview ruler of the given width using the given annotation access and color manager.

Note: As of 3.4, temporary annotations are no longer discolored. Use LpexOverviewRuler(IAnnotationAccess, int, ISharedTextColors, boolean) if you want to keep the old behavior.

Parameters:
annotationAccess - the annotation access
width - the width of the vertical ruler
sharedColors - the color manager

LpexOverviewRuler

public LpexOverviewRuler(IAnnotationAccess annotationAccess,
                         int width,
                         ISharedTextColors sharedColors,
                         boolean discolorTemporaryAnnotation)
Constructs a overview ruler of the given width using the given annotation access and color manager.

Parameters:
annotationAccess - the annotation access
width - the width of the vertical ruler
sharedColors - the color manager
discolorTemporaryAnnotation - true if temporary annotations should be discolored
Method Detail

getControl

public Control getControl()

getWidth

public int getWidth()

setModel

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

See Also:
IVerticalRuler

createControl

public Control createControl(Composite parent,
                             ITextViewer textViewer)
Creates the overview ruler's SWT control, a Canvas, for the LpexTextViewer specified.

Parameters:
textViewer - the LpexTextViewer associated with this ruler
See Also:
IVerticalRuler

update

public void update()
Forces the overview ruler to update. This method can be called from any thread.

See Also:
IVerticalRuler

addAnnotationType

public void addAnnotationType(Object annotationType)

removeAnnotationType

public void removeAnnotationType(Object annotationType)

setAnnotationTypeLayer

public void setAnnotationTypeLayer(Object annotationType,
                                   int layer)

setAnnotationTypeColor

public void setAnnotationTypeColor(Object annotationType,
                                   Color color)

getLineOfLastMouseButtonActivity

public int getLineOfLastMouseButtonActivity()

toDocumentLineNumber

public int toDocumentLineNumber(int y_coordinate)

getModel

public IAnnotationModel getModel()

getAnnotationHeight

public int getAnnotationHeight()

hasAnnotation

public boolean hasAnnotation(int y)

getHeaderControl

public Control getHeaderControl()

addHeaderAnnotationType

public void addHeaderAnnotationType(Object annotationType)

removeHeaderAnnotationType

public void removeHeaderAnnotationType(Object annotationType)

setUseSaturatedColors

public void setUseSaturatedColors(boolean useSaturatedColor)
Since:
4.2
See Also:
IOverviewRulerExtension

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.