Package 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
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for the bookmark system image.static final StringConstant for the error system image.protected MarkerAnnotationPreferencesDeprecated.As of 3.0, no replacementstatic final StringConstant for the info system image.static final StringConstant for the task system image.static final StringDeprecated.As of 3.0, replaced by Annotation.TYPE_UNKNOWNstatic final StringConstant for the warning system image.Fields inherited from interface org.eclipse.jface.text.source.IAnnotationAccessExtension
DEFAULT_LAYER -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 byDefaultMarkerAnnotationAccess() -
Method Summary
Modifier and TypeMethodDescriptionprotected AnnotationPreferenceLookupReturns the annotation preference lookup used by this annotation access.protected org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchyReturns the annotation type hierarchy used by this annotation access.intgetLayer(Annotation annotation) Returns the layer for given annotation.static StringgetSharedImageName(String symbolicImageName) Translates the given symbolic image name into the shared image name as defined inISharedImages.Object[]getSupertypes(Object annotationType) Returns the list of super types for the given annotation type.getType(Annotation annotation) Deprecated.useAnnotation.getType()getTypeLabel(Annotation annotation) Returns the label for the given annotation's type.protected booleanhasQuickFix(Annotation annotation) Checks whether there's a quick assist assistant and if so, whether the assistant has a possible fix for the given annotation.booleanisMultiLine(Annotation annotation) Deprecated.assumed to always returntruebooleanisPaintable(Annotation annotation) Returnstrueif paintingannotationwill produce something meaningful,falseif not.booleanReturnstrueif the given annotation is of the given type orfalseotherwise.booleanisTemporary(Annotation annotation) Deprecated.assumed to always returntruevoidpaint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds) Draws a graphical representation of the given annotation within the given bounds.voidsetQuickAssistAssistant(IQuickAssistAssistant assistant) Provides this annotation access with a quick assist assistant that is used to decide whether the quick fix image should be shown.
-
Field Details
-
UNKNOWN
Deprecated.As of 3.0, replaced by Annotation.TYPE_UNKNOWNConstant for the unknown marker type.- See Also:
-
ERROR_SYSTEM_IMAGE
Constant for the error system image. Value:error- Since:
- 3.0
- See Also:
-
WARNING_SYSTEM_IMAGE
Constant for the warning system image. Value:warning- Since:
- 3.0
- See Also:
-
INFO_SYSTEM_IMAGE
Constant for the info system image. Value:info- Since:
- 3.0
- See Also:
-
TASK_SYSTEM_IMAGE
Constant for the task system image. Value:task- Since:
- 3.0
- See Also:
-
BOOKMARK_SYSTEM_IMAGE
Constant for the bookmark system image. Value:bookmark- Since:
- 3.0
- See Also:
-
fMarkerAnnotationPreferences
Deprecated.As of 3.0, no replacementThe marker annotation preferences.
-
-
Constructor Details
-
DefaultMarkerAnnotationAccess
@Deprecated public DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences) Deprecated.As of 3.0, replaced byDefaultMarkerAnnotationAccess()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 Details
-
setQuickAssistAssistant
Description copied from interface:IAnnotationAccessExtension2Provides this annotation access with a quick assist assistant that is used to decide whether the quick fix image should be shown.- Specified by:
setQuickAssistAssistantin interfaceIAnnotationAccessExtension2- Parameters:
assistant- the quick assist assistant
-
getAnnotationPreferenceLookup
Returns the annotation preference lookup used by this annotation access.- Returns:
- the annotation preference lookup
- Since:
- 3.0
-
getType
Deprecated.useAnnotation.getType()Returns the type of the given annotation.- Specified by:
getTypein interfaceIAnnotationAccess- Parameters:
annotation- the annotation- Returns:
- the type of the given annotation or
nullif it has none.
-
isMultiLine
Deprecated.assumed to always returntrueReturns whether the given annotation spans multiple lines.- Specified by:
isMultiLinein interfaceIAnnotationAccess- Parameters:
annotation- the annotation- Returns:
trueif the annotation spans multiple lines,falseotherwise
-
isTemporary
Deprecated.assumed to always returntrueReturns whether the given annotation is temporary rather than persistent.- Specified by:
isTemporaryin interfaceIAnnotationAccess- Parameters:
annotation- the annotation- Returns:
trueif the annotation is temporary,falseotherwise
-
getTypeLabel
Description copied from interface:IAnnotationAccessExtensionReturns the label for the given annotation's type.- Specified by:
getTypeLabelin interfaceIAnnotationAccessExtension- Parameters:
annotation- the annotation- Returns:
- the label the given annotation's type or
nullif no such label exists
-
getLayer
Description copied from interface:IAnnotationAccessExtensionReturns 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:
getLayerin interfaceIAnnotationAccessExtension- Parameters:
annotation- the annotation- Returns:
- the layer of the given annotation
-
paint
Description copied from interface:IAnnotationAccessExtensionDraws 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:
paintin interfaceIAnnotationAccessExtension- Parameters:
annotation- the given annotationgc- the drawing GCcanvas- the canvas to draw onbounds- the bounds inside the canvas to draw on
-
isPaintable
Description copied from interface:IAnnotationAccessExtensionReturnstrueif paintingannotationwill produce something meaningful,falseif 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:
isPaintablein interfaceIAnnotationAccessExtension- Parameters:
annotation- the annotation to check whether it can be painted- Returns:
trueif paintingannotationwill succeed
-
isSubtype
Description copied from interface:IAnnotationAccessExtensionReturnstrueif the given annotation is of the given type orfalseotherwise.- Specified by:
isSubtypein interfaceIAnnotationAccessExtension- Parameters:
annotationType- the annotation typepotentialSupertype- the potential super annotation type- Returns:
trueif annotation type is a sub-type of the potential annotation super type
-
getSupertypes
Description copied from interface:IAnnotationAccessExtensionReturns 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:
getSupertypesin interfaceIAnnotationAccessExtension- 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.
-
hasQuickFix
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:
trueif there is quick fix- Since:
- 3.2
-