Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jface.text.source
Class OverviewRuler

    java.lang.Object
      org.eclipse.jface.text.source.OverviewRuler

All Implemented Interfaces:
  IOverviewRuler, IVerticalRuler, IVerticalRulerInfo

public class OverviewRuler
extends Object
implements IOverviewRuler

Ruler presented next to a source viewer 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.

Since:
  2.1

Constructor Summary
`OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors)` Constructs a overview ruler of the given width using the given annotation access and the given color manager.

Method Summary
`void` | `addAnnotationType(Object annotationType)` Adds the given annotation type to this overview ruler.
`void` | `addHeaderAnnotationType(Object annotationType)` Adds the given annotation type to the header of this ruler.
`Control` | `createControl(Composite parent, ITextViewer textViewer)` Creates the ruler's SWT control.
`int` | `getAnnotationHeight()` Returns the height of the visual presentation of an annotation in this overview ruler.
`Control` | `getControl()` Returns the ruler's SWT control.
`Control` | `getHeaderControl()` Returns this rulers header control.
`int` | `getLineOfLastMouseButtonActivity()` Returns the line number of the last mouse button activity.
`IAnnotationModel` | `getModel()` Returns the current annotation model of this ruler or `null` if the ruler has no model.
`int` | `getWidth()` Returns the width of this ruler's control.
`boolean` | `hasAnnotation(int y)` Returns whether there is an annotation an the given vertical coordinate.
`void` | `removeAnnotationType(Object annotationType)` Removes the given annotation type from this overview ruler.
`void` | `removeHeaderAnnotationType(Object annotationType)` Removes the given annotation type from the header of this ruler.
`void` | `setAnnotationTypeColor(Object annotationType, Color color)` Sets the color for the given annotation type in this overview ruler.
`void` | `setAnnotationTypeLayer(Object annotationType, int layer)` Sets the drawing layer for the given annotation type in this overview ruler.
`void` | `setModel(IAnnotationModel model)` Associates an annotation model with this ruler.
`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.
`void` | `update()` Forces the vertical ruler to synchronize itself with its annotation model and its viewer's view port.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OverviewRuler

    public OverviewRuler(IAnnotationAccess annotationAccess,
                         int width,
                         ISharedTextColors sharedColors)

  Constructs a overview ruler of the given width using the given annotation access and the given color manager.

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

Method Detail

### getControl

    public Control getControl()

  Description copied from interface: `IVerticalRulerInfo`
  Returns the ruler's SWT control.

  Specified by:
    `getControl` in interface `IVerticalRulerInfo`
  Returns:
    the ruler's SWT control

### getWidth

    public int getWidth()

  Description copied from interface: `IVerticalRulerInfo`
  Returns the width of this ruler's control.

  Specified by:
    `getWidth` in interface `IVerticalRulerInfo`
  Returns:
    the width of this ruler's control

### setModel

    public void setModel(IAnnotationModel model)

  Description copied from interface: `IVerticalRuler`
  Associates an annotation model with this ruler. A value `null` is acceptable and clears the ruler.

  Specified by:
    `setModel` in interface `IVerticalRuler`
  Parameters:
    `model` - the new annotation model, may be `null`

### createControl

    public Control createControl(Composite parent,
                                 ITextViewer textViewer)

  Description copied from interface: `IVerticalRuler`
  Creates the ruler's SWT control.

  Specified by:
    `createControl` in interface `IVerticalRuler`
  Parameters:
    `parent` - the parent control of the ruler's control
    `textViewer` - the text viewer to which this ruler belongs
  Returns:
    the ruler's SWT control

### update

    public void update()

  Description copied from interface: `IVerticalRuler`
  Forces the vertical ruler to synchronize itself with its annotation model and its viewer's view port.

  Specified by:
    `update` in interface `IVerticalRuler`

### addAnnotationType

    public void addAnnotationType(Object annotationType)

  Description copied from interface: `IOverviewRuler`
  Adds the given annotation type to this overview ruler. Starting with this call, annotations of the given type are shown in the overview ruler.

  Specified by:
    `addAnnotationType` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type

### removeAnnotationType

    public void removeAnnotationType(Object annotationType)

  Description copied from interface: `IOverviewRuler`
  Removes the given annotation type from this overview ruler. Annotations of the given type are no longer shown in the overview ruler.

  Specified by:
    `removeAnnotationType` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type

### setAnnotationTypeLayer

    public void setAnnotationTypeLayer(Object annotationType,
                                       int layer)

  Description copied from interface: `IOverviewRuler`
  Sets the drawing layer for the given annotation type in this overview ruler.

  Specified by:
    `setAnnotationTypeLayer` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type
    `layer` - the drawing layer

### setAnnotationTypeColor

    public void setAnnotationTypeColor(Object annotationType,
                                       Color color)

  Description copied from interface: `IOverviewRuler`
  Sets the color for the given annotation type in this overview ruler.

  Specified by:
    `setAnnotationTypeColor` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type
    `color` - the color

### getLineOfLastMouseButtonActivity

    public int getLineOfLastMouseButtonActivity()

  Description copied from interface: `IVerticalRulerInfo`
  Returns the line number of the last mouse button activity. Based on the input document of the connected text viewer. The smallest possible line number is `0`.

  Specified by:
    `getLineOfLastMouseButtonActivity` in interface `IVerticalRulerInfo`
  Returns:
    the line number of the last mouse button activity

### toDocumentLineNumber

    public int toDocumentLineNumber(int y_coordinate)

  Description copied from interface: `IVerticalRulerInfo`
  Translates a y-coordinate of the ruler's SWT control into the according line number of the document of the connected text viewer.

  Specified by:
    `toDocumentLineNumber` in interface `IVerticalRulerInfo`
  Parameters:
    `y_coordinate` - a y-coordinate of the ruler's SWT control
  Returns:
    the line number of that coordinate or `-1` if that coordinate does not correspond to a valid document line

### getModel

    public IAnnotationModel getModel()

  Description copied from interface: `IVerticalRuler`
  Returns the current annotation model of this ruler or `null` if the ruler has no model.

  Specified by:
    `getModel` in interface `IVerticalRuler`
  Returns:
    this ruler's annotation model or `null` if there is no model

### getAnnotationHeight

    public int getAnnotationHeight()

  Description copied from interface: `IOverviewRuler`
  Returns the height of the visual presentation of an annotation in this overview ruler. Assumes that all annotations are represented using the same height.

  Specified by:
    `getAnnotationHeight` in interface `IOverviewRuler`
  Returns:
    int the visual height of an annotation

### hasAnnotation

    public boolean hasAnnotation(int y)

  Description copied from interface: `IOverviewRuler`
  Returns whether there is an annotation an the given vertical coordinate. This method takes the compression factor of the overview ruler into account.

  Specified by:
    `hasAnnotation` in interface `IOverviewRuler`
  Parameters:
    `y` - the y-coordinate
  Returns:
    `true` if there is an annotation, `false` otherwise

### getHeaderControl

    public Control getHeaderControl()

  Description copied from interface: `IOverviewRuler`
  Returns this rulers header control. This is the little area between the top of the text widget and the top of this overview ruler.

  Specified by:
    `getHeaderControl` in interface `IOverviewRuler`
  Returns:
    the header control of this overview ruler.

### addHeaderAnnotationType

    public void addHeaderAnnotationType(Object annotationType)

  Description copied from interface: `IOverviewRuler`
  Adds the given annotation type to the header of this ruler. Starting with this call, the presence of annotations is tracked and the header is drawn in the configured color.

  Specified by:
    `addHeaderAnnotationType` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type to be tracked

### removeHeaderAnnotationType

    public void removeHeaderAnnotationType(Object annotationType)

  Description copied from interface: `IOverviewRuler`
  Removes the given annotation type from the header of this ruler. The presence of annotations of the given type is no longer tracked and the header is drawn in the default color, depending on the other configured configured annotation types.

  Specified by:
    `removeHeaderAnnotationType` in interface `IOverviewRuler`
  Parameters:
    `annotationType` - the annotation type to be removed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.