public class DefaultMarkerAnnotationAccess extends Object implements IAnnotationAccess, IAnnotationAccessExtension, IAnnotationAccessExtension2
Modifier and Type | Field and Description |
---|---|
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.
|
DEFAULT_LAYER
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() |
Modifier and Type | Method and Description |
---|---|
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.
|
@Deprecated public static final String UNKNOWN
public static final String ERROR_SYSTEM_IMAGE
error
public static final String WARNING_SYSTEM_IMAGE
warning
public static final String INFO_SYSTEM_IMAGE
info
public static final String TASK_SYSTEM_IMAGE
task
public static final String BOOKMARK_SYSTEM_IMAGE
bookmark
@Deprecated protected MarkerAnnotationPreferences fMarkerAnnotationPreferences
@Deprecated public DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences)
DefaultMarkerAnnotationAccess()
markerAnnotationPreferences
- the marker annotation preferencepublic DefaultMarkerAnnotationAccess()
public void setQuickAssistAssistant(IQuickAssistAssistant assistant)
IAnnotationAccessExtension2
setQuickAssistAssistant
in interface IAnnotationAccessExtension2
assistant
- the quick assist assistantprotected AnnotationPreferenceLookup getAnnotationPreferenceLookup()
@Deprecated public Object getType(Annotation annotation)
Annotation.getType()
getType
in interface IAnnotationAccess
annotation
- the annotationnull
if it has none.@Deprecated public boolean isMultiLine(Annotation annotation)
true
isMultiLine
in interface IAnnotationAccess
annotation
- the annotationtrue
if the annotation spans multiple lines,
false
otherwise@Deprecated public boolean isTemporary(Annotation annotation)
true
isTemporary
in interface IAnnotationAccess
annotation
- the annotationtrue
if the annotation is temporary,
false
otherwisepublic String getTypeLabel(Annotation annotation)
IAnnotationAccessExtension
getTypeLabel
in interface IAnnotationAccessExtension
annotation
- the annotationnull
if no such label existspublic int getLayer(Annotation annotation)
IAnnotationAccessExtension
getLayer
in interface IAnnotationAccessExtension
annotation
- the annotationpublic void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds)
IAnnotationAccessExtension
Note that this method is not used when drawing annotations on the editor's
text widget. This is handled trough a AnnotationPainter.IDrawingStrategy
.
paint
in interface IAnnotationAccessExtension
annotation
- the given annotationgc
- the drawing GCcanvas
- the canvas to draw onbounds
- the bounds inside the canvas to draw onpublic boolean isPaintable(Annotation annotation)
IAnnotationAccessExtension
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
.
isPaintable
in interface IAnnotationAccessExtension
annotation
- the annotation to check whether it can be paintedtrue
if painting annotation
will succeedpublic boolean isSubtype(Object annotationType, Object potentialSupertype)
IAnnotationAccessExtension
true
if the given annotation is of the given type
or false
otherwise.isSubtype
in interface IAnnotationAccessExtension
annotationType
- the annotation typepotentialSupertype
- the potential super annotation typetrue
if annotation type is a sub-type of the potential annotation super typepublic Object[] getSupertypes(Object annotationType)
IAnnotationAccessExtension
getSupertypes
in interface IAnnotationAccessExtension
annotationType
- the annotation type to checkprotected org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy getAnnotationTypeHierarchy()
public static String getSharedImageName(String symbolicImageName)
ISharedImages
.
The symbolic image name must be one of the
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 pointIllegalArgumentException
- if the symbolicImageName
is not defined by the
org.eclipse.ui.editors.markerAnnotationSpecification
extension pointprotected boolean hasQuickFix(Annotation annotation)
annotation
- the annotationtrue
if there is quick fix
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.