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
Interface IOverviewRuler

All Superinterfaces:
  IVerticalRuler, IVerticalRulerInfo

All Known Implementing Classes:
  OverviewRuler

public interface IOverviewRuler
extends IVerticalRuler

This interface defines a visual component which may serve text viewers as an overview annotation presentation area. This means, presentation of annotations is independent from the actual view port of the text viewer. The annotations of the viewer's whole document are visible in the overview ruler. This interfaces embodies three contracts:

- The overview ruler retrieves the annotations it presents from an annotation model.
- The ruler is a visual component which must be integrated in a hierarchy of SWT controls.
- The ruler provides interested clients with mapping and interaction information. This covers the mapping between coordinates of the ruler's control and line numbers based on the connected text viewer's document (`IVerticalRulerInfo`).

Clients may implement this interface or use the default implementation provided by `OverviewlRuler`.

Since:
  2.1
See Also:
  `ITextViewer`

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.
`int` | `getAnnotationHeight()` Returns the height of the visual presentation of an annotation in this overview ruler.
`Control` | `getHeaderControl()` Returns this rulers header 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.

Methods inherited from interface org.eclipse.jface.text.source.IVerticalRuler
`createControl, getModel, setModel, update`

Methods inherited from interface org.eclipse.jface.text.source.IVerticalRulerInfo
`getControl, getLineOfLastMouseButtonActivity, getWidth, toDocumentLineNumber`

Method Detail

### hasAnnotation

    public boolean hasAnnotation(int y)

  Returns whether there is an annotation an the given vertical coordinate. This method takes the compression factor of the overview ruler into account.

  Parameters:
    `y` - the y-coordinate
  Returns:
    `true` if there is an annotation, `false` otherwise

### getAnnotationHeight

    public int getAnnotationHeight()

  Returns the height of the visual presentation of an annotation in this overview ruler. Assumes that all annotations are represented using the same height.

  Returns:
    int the visual height of an annotation

### setAnnotationTypeColor

    public void setAnnotationTypeColor(Object annotationType,
                                       Color color)

  Sets the color for the given annotation type in this overview ruler.

  Parameters:
    `annotationType` - the annotation type
    `color` - the color

### setAnnotationTypeLayer

    public void setAnnotationTypeLayer(Object annotationType,
                                       int layer)

  Sets the drawing layer for the given annotation type in this overview ruler.

  Parameters:
    `annotationType` - the annotation type
    `layer` - the drawing layer

### addAnnotationType

    public void addAnnotationType(Object annotationType)

  Adds the given annotation type to this overview ruler. Starting with this call, annotations of the given type are shown in the overview ruler.

  Parameters:
    `annotationType` - the annotation type

### removeAnnotationType

    public void removeAnnotationType(Object annotationType)

  Removes the given annotation type from this overview ruler. Annotations of the given type are no longer shown in the overview ruler.

  Parameters:
    `annotationType` - the annotation type

### addHeaderAnnotationType

    public void addHeaderAnnotationType(Object annotationType)

  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.

  Parameters:
    `annotationType` - the annotation type to be tracked

### removeHeaderAnnotationType

    public void removeHeaderAnnotationType(Object annotationType)

  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.

  Parameters:
    `annotationType` - the annotation type to be removed

### getHeaderControl

    public Control getHeaderControl()

  Returns this rulers header control. This is the little area between the top of the text widget and the top of this overview ruler.

  Returns:
    the header control of this overview ruler.

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.