Package org.eclipse.ui.texteditor
Class MarkerAnnotation
java.lang.Object
org.eclipse.jface.text.source.Annotation
org.eclipse.ui.texteditor.SimpleMarkerAnnotation
org.eclipse.ui.texteditor.MarkerAnnotation
- All Implemented Interfaces:
IQuickFixableAnnotation
Annotation representing a marker on a resource in the workspace.
This class may be instantiated or be subclassed.
- See Also:
-
Field Summary
FieldsFields inherited from class org.eclipse.jface.text.source.Annotation
TYPE_UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionMarkerAnnotation(String annotationType, IMarker marker) Creates a new annotation of the given type for the given marker.MarkerAnnotation(IMarker marker) Creates a new annotation for the given marker. -
Method Summary
Modifier and TypeMethodDescriptionprotected ImageDeprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationprotected ImageDeprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationprotected static ImagegetImage(Display display, ImageDescriptor descriptor) Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationprotected static Map<ImageDescriptor, Image> getImageRegistry(Display display) Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationintgetLayer()Deprecated.As of 3.0, replaced byIAnnotationAccessExtension.getLayer(org.eclipse.jface.text.source.Annotation)protected StringgetUnknownImageName(IMarker marker) Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationprotected voidDeprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationbooleanTells whether there are quick fixes for this annotation.booleanTells whether the quick fixable state has been set.voidDeprecated.protected voidDeprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationprotected voidsetLayer(int layer) Deprecated.As of 3.0, annotation with a visible presentation should implementIAnnotationPresentationvoidsetQuickFixable(boolean state) Sets whether there are quick fixes available for this annotation.voidupdate()Informs this annotation about changes applied to its underlying marker and adapts to those changes.Methods inherited from class org.eclipse.ui.texteditor.SimpleMarkerAnnotation
equals, getMarker, getText, hashCodeMethods inherited from class org.eclipse.jface.text.source.Annotation
getType, isMarkedDeleted, isPersistent, markDeleted, setText, setType
-
Field Details
-
PROBLEM_LAYER
Deprecated.As of 3.0, replaced byIAnnotationAccessExtensionThe layer in which markers representing problem are located.- Since:
- 2.0
- See Also:
-
-
Constructor Details
-
MarkerAnnotation
Creates a new annotation for the given marker.- Parameters:
marker- the marker
-
MarkerAnnotation
Creates a new annotation of the given type for the given marker.- Parameters:
annotationType- the annotation typemarker- the marker- Since:
- 3.0
-
-
Method Details
-
getImage
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationReturns an image for the given display as specified by the given image descriptor.- Parameters:
display- the displaydescriptor- the image descriptor- Returns:
- an image for the display as specified by the descriptor
-
getImageRegistry
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationReturns an image registry for the given display. If no such registry exists the registry is created.- Parameters:
display- the display- Returns:
- the image registry for the given display
-
setImage
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationSets the marker image to the given image.- Parameters:
image- the new marker image
-
initialize
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationInitializes the annotation's icon representation and its drawing layer based upon the properties of the underlying marker. -
getLayer
Deprecated.As of 3.0, replaced byIAnnotationAccessExtension.getLayer(org.eclipse.jface.text.source.Annotation)Returns the annotations drawing layer.Note: This is only for backward compatibility.
- Returns:
- the annotations drawing layer
- Since:
- 3.0
-
setLayer
Deprecated.As of 3.0, annotation with a visible presentation should implementIAnnotationPresentationSets the layer of this annotation.Note: This is only for backward compatibility.
- Parameters:
layer- the layer of this annotation- Since:
- 3.0
-
paint
Deprecated.Implement this method to draw a graphical representation of this annotation within the given bounds. This default implementation does nothing.Note: This is only for backward compatibility.
- Parameters:
gc- the drawing GCcanvas- the canvas to draw onr- the bounds inside the canvas to draw on- Since:
- 3.0
-
update
public void update()Informs this annotation about changes applied to its underlying marker and adapts to those changes.- Overrides:
updatein classSimpleMarkerAnnotation
-
getUnknownImageName
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationReturns the name of an image used to visually represent markers of unknown type. This implementation returnsnull. Subclasses may replace this method.- Parameters:
marker- the marker of unknown type- Returns:
- the name of an image for markers of unknown type.
-
getImage
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationReturns the image of the given name. Subclasses may extend this method. If so, subclasses must assume responsibility for disposing the images they create.- Parameters:
name- the name of the requested image- Returns:
- the image or
nullif there is no such image
-
getImage
Deprecated.As of 3.0, visual presentation is no longer supported, annotation with a visible presentation should implementIAnnotationPresentationReturns an image for this annotation. It first consults the workbench adapter for this annotation's marker. If none is defined, it tries to find an image for the image name of this annotation.- Parameters:
display- the display for which the image is requested- Returns:
- the image for this annotation
-
setQuickFixable
public void setQuickFixable(boolean state) Sets whether there are quick fixes available for this annotation.- Specified by:
setQuickFixablein interfaceIQuickFixableAnnotation- Parameters:
state-trueif there are quick fixes available, false otherwise- Since:
- 3.4
-
isQuickFixableStateSet
public boolean isQuickFixableStateSet()Tells whether the quick fixable state has been set.Normally this means
IQuickFixableAnnotation.setQuickFixable(boolean)has been called at least once but it can also be hard-coded, e.g. always returntrue.- Specified by:
isQuickFixableStateSetin interfaceIQuickFixableAnnotation- Returns:
trueif the state has been set- Since:
- 3.4
-
isQuickFixable
public boolean isQuickFixable()Tells whether there are quick fixes for this annotation.Note: This method must only be called if
IQuickFixableAnnotation.isQuickFixableStateSet()returnstrue.- Specified by:
isQuickFixablein interfaceIQuickFixableAnnotation- Returns:
trueif this annotation offers quick fixes- Since:
- 3.4
-
IAnnotationAccessExtension