org.eclipse.ui.texteditor

## Class DefaultMarkerAnnotationAccess

- java.lang.Object
- - org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess

All Implemented Interfaces:
  IAnnotationAccess, IAnnotationAccessExtension, IAnnotationAccessExtension2

    public class DefaultMarkerAnnotationAccess
    extends Object
    implements IAnnotationAccess, IAnnotationAccessExtension, IAnnotationAccessExtension2

Default class for accessing marker annotation properties.

Since:
  2.1

### Field Summary

Fields
`static String` `BOOKMARK_SYSTEM_IMAGE` Constant for the bookmark system image.
`static String` `ERROR_SYSTEM_IMAGE` Constant for the error system image.
`protected MarkerAnnotationPreferences` `fMarkerAnnotationPreferences` Deprecated. As of 3.0, no replacement
`static String` `INFO_SYSTEM_IMAGE` Constant for the info system image.
`static String` `TASK_SYSTEM_IMAGE` Constant for the task system image.
`static String` `UNKNOWN` Deprecated. As of 3.0, replaced by Annotation.TYPE_UNKNOWN
`static String` `WARNING_SYSTEM_IMAGE` Constant for the warning system image.

### Fields inherited from interface org.eclipse.jface.text.source.IAnnotationAccessExtension

`DEFAULT_LAYER`

### Constructor Summary

Constructors
Constructor and Description
`DefaultMarkerAnnotationAccess()` Creates a new default marker annotation access using the standard preference lookup strategy which is the one provided by the enclosing plug-in.
`DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences)` Deprecated. As of 3.0, replaced by `DefaultMarkerAnnotationAccess()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`protected AnnotationPreferenceLookup` `getAnnotationPreferenceLookup()` Returns the annotation preference lookup used by this annotation access.
`protected org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy` `getAnnotationTypeHierarchy()` Returns the annotation type hierarchy used by this annotation access.
`int` `getLayer(Annotation annotation)` Returns the layer for given annotation.
`static String` `getSharedImageName(String symbolicImageName)` Translates the given symbolic image name into the shared image name as defined in `ISharedImages`.
`Object[]` `getSupertypes(Object annotationType)` Returns the list of super types for the given annotation type.
`Object` `getType(Annotation annotation)` Deprecated. use `Annotation.getType()`
`String` `getTypeLabel(Annotation annotation)` Returns the label for the given annotation's type.
`protected boolean` `hasQuickFix(Annotation annotation)` Checks whether there's a quick assist assistant and if so, whether the assistant has a possible fix for the given annotation.
`boolean` `isMultiLine(Annotation annotation)` Deprecated. assumed to always return `true`
`boolean` `isPaintable(Annotation annotation)` Returns `true` if painting `annotation` will produce something meaningful, `false` if not.
`boolean` `isSubtype(Object annotationType, Object potentialSupertype)` Returns `true` if the given annotation is of the given type or `false` otherwise.
`boolean` `isTemporary(Annotation annotation)` Deprecated. assumed to always return `true`
`void` `paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds)` Draws a graphical representation of the given annotation within the given bounds.
`void` `setQuickAssistAssistant(IQuickAssistAssistant assistant)` Provides this annotation access with a quick assist assistant that is used to decide whether the quick fix image should be shown.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### UNKNOWN

    @Deprecated
    public static final String UNKNOWN

Deprecated. As of 3.0, replaced by Annotation.TYPE_UNKNOWN
Constant for the unknown marker type.

See Also:
  Constant Field Values

#### ERROR_SYSTEM_IMAGE

    public static final String ERROR_SYSTEM_IMAGE

Constant for the error system image. Value: `error`

Since:
  3.0
See Also:
  Constant Field Values

#### WARNING_SYSTEM_IMAGE

    public static final String WARNING_SYSTEM_IMAGE

Constant for the warning system image. Value: `warning`

Since:
  3.0
See Also:
  Constant Field Values

#### INFO_SYSTEM_IMAGE

    public static final String INFO_SYSTEM_IMAGE

Constant for the info system image. Value: `info`

Since:
  3.0
See Also:
  Constant Field Values

#### TASK_SYSTEM_IMAGE

    public static final String TASK_SYSTEM_IMAGE

Constant for the task system image. Value: `task`

Since:
  3.0
See Also:
  Constant Field Values

#### BOOKMARK_SYSTEM_IMAGE

    public static final String BOOKMARK_SYSTEM_IMAGE

Constant for the bookmark system image. Value: `bookmark`

Since:
  3.0
See Also:
  Constant Field Values

#### fMarkerAnnotationPreferences

    @Deprecated
    protected MarkerAnnotationPreferences fMarkerAnnotationPreferences

Deprecated. As of 3.0, no replacement
The marker annotation preferences.

### Constructor Detail

#### DefaultMarkerAnnotationAccess

    @Deprecated
    public DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences)

Deprecated. As of 3.0, replaced by `DefaultMarkerAnnotationAccess()`
Returns a new default marker annotation access with the given preferences.

Parameters:
  `markerAnnotationPreferences` - the marker annotation preference

#### DefaultMarkerAnnotationAccess

    public DefaultMarkerAnnotationAccess()

Creates a new default marker annotation access using the standard preference lookup strategy which is the one provided by the enclosing plug-in.

Since:
  3.0

### Method Detail

#### setQuickAssistAssistant

    public void setQuickAssistAssistant(IQuickAssistAssistant assistant)

Description copied from interface: `IAnnotationAccessExtension2`
Provides this annotation access with a quick assist assistant that is used to decide whether the quick fix image should be shown.

Specified by:
  `setQuickAssistAssistant` in interface `IAnnotationAccessExtension2`
Parameters:
  `assistant` - the quick assist assistant

#### getAnnotationPreferenceLookup

    protected AnnotationPreferenceLookup getAnnotationPreferenceLookup()

Returns the annotation preference lookup used by this annotation access.

Returns:
  the annotation preference lookup
Since:
  3.0

#### getType

    @Deprecated
    public Object getType(Annotation annotation)

Deprecated. use `Annotation.getType()`
Returns the type of the given annotation.

Specified by:
  `getType` in interface `IAnnotationAccess`
Parameters:
  `annotation` - the annotation
Returns:
  the type of the given annotation or `null` if it has none.

#### isMultiLine

    @Deprecated
    public boolean isMultiLine(Annotation annotation)

Deprecated. assumed to always return `true`
Returns whether the given annotation spans multiple lines.

Specified by:
  `isMultiLine` in interface `IAnnotationAccess`
Parameters:
  `annotation` - the annotation
Returns:
  `true` if the annotation spans multiple lines, `false` otherwise

#### isTemporary

    @Deprecated
    public boolean isTemporary(Annotation annotation)

Deprecated. assumed to always return `true`
Returns whether the given annotation is temporary rather than persistent.

Specified by:
  `isTemporary` in interface `IAnnotationAccess`
Parameters:
  `annotation` - the annotation
Returns:
  `true` if the annotation is temporary, `false` otherwise

#### getTypeLabel

    public String getTypeLabel(Annotation annotation)

Description copied from interface: `IAnnotationAccessExtension`
Returns the label for the given annotation's type.

Specified by:
  `getTypeLabel` in interface `IAnnotationAccessExtension`
Parameters:
  `annotation` - the annotation
Returns:
  the label the given annotation's type or `null` if no such label exists

#### getLayer

    public int getLayer(Annotation annotation)

Description copied from interface: `IAnnotationAccessExtension`
Returns the layer for given annotation. Annotations are considered being located at layers and are considered being painted starting with layer 0 upwards. Thus an annotation at layer 5 will be drawn on top of all co-located annotations at the layers 4 - 0.

Specified by:
  `getLayer` in interface `IAnnotationAccessExtension`
Parameters:
  `annotation` - the annotation
Returns:
  the layer of the given annotation

#### paint

    public void paint(Annotation annotation,
                      GC gc,
                      Canvas canvas,
                      Rectangle bounds)

Description copied from interface: `IAnnotationAccessExtension`
Draws a graphical representation of the given annotation within the given bounds.

Note that this method is not used when drawing annotations on the editor's text widget. This is handled trough a `AnnotationPainter.IDrawingStrategy`.

Specified by:
  `paint` in interface `IAnnotationAccessExtension`
Parameters:
  `annotation` - the given annotation
  `gc` - the drawing GC
  `canvas` - the canvas to draw on
  `bounds` - the bounds inside the canvas to draw on

#### isPaintable

    public boolean isPaintable(Annotation annotation)

Description copied from interface: `IAnnotationAccessExtension`
Returns `true` if painting `annotation` will produce something meaningful, `false` if not. E.g. if no image is available.

Note that this method is not used when drawing annotations on the editor's text widget. This is handled trough a `AnnotationPainter.IDrawingStrategy`.

Specified by:
  `isPaintable` in interface `IAnnotationAccessExtension`
Parameters:
  `annotation` - the annotation to check whether it can be painted
Returns:
  `true` if painting `annotation` will succeed

#### isSubtype

    public boolean isSubtype(Object annotationType,
                             Object potentialSupertype)

Description copied from interface: `IAnnotationAccessExtension`
Returns `true` if the given annotation is of the given type or `false` otherwise.

Specified by:
  `isSubtype` in interface `IAnnotationAccessExtension`
Parameters:
  `annotationType` - the annotation type
  `potentialSupertype` - the potential super annotation type
Returns:
  `true` if annotation type is a sub-type of the potential annotation super type

#### getSupertypes

    public Object[] getSupertypes(Object annotationType)

Description copied from interface: `IAnnotationAccessExtension`
Returns the list of super types for the given annotation type. This does not include the type itself. The index in the array of super types indicates the length of the path in the hierarchy graph to the given annotation type.

Specified by:
  `getSupertypes` in interface `IAnnotationAccessExtension`
Parameters:
  `annotationType` - the annotation type to check
Returns:
  the super types for the given annotation type

#### getAnnotationTypeHierarchy

    protected org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy getAnnotationTypeHierarchy()

Returns the annotation type hierarchy used by this annotation access.

Returns:
  the annotation type hierarchy
Since:
  3.0
Restriction:
  This method is not intended to be referenced by clients.

#### getSharedImageName

    public static String getSharedImageName(String symbolicImageName)

Translates the given symbolic image name into the shared image name as defined in `ISharedImages`.

The symbolic image name must be one of the

Parameters:
  `symbolicImageName` - the symbolic image name, which must be one of the valid values defined for the `symbolicIcon` attribute in the `org.eclipse.ui.editors.markerAnnotationSpecification` extension point
Returns:
  the shared image name
Throws:
  `IllegalArgumentException` - if the `symbolicImageName` is not defined by the `org.eclipse.ui.editors.markerAnnotationSpecification` extension point
Since:
  3.4

#### hasQuickFix

    protected boolean hasQuickFix(Annotation annotation)

Checks whether there's a quick assist assistant and if so, whether the assistant has a possible fix for the given annotation.

Parameters:
  `annotation` - the annotation
Returns:
  `true` if there is quick fix
Since:
  3.2