An annotation preference provides all the information required for handing
the preferences for the presentation of annotations of a specified type. The
type can be changed and retrieved using the getAnnotationType
and setAnnotationType methods. For each preference, getter and
setter methods are provided.
Preferences that may be changed by the user also have a corresponding key
that can be used to obtain the currently set value from an
IPreferenceStore.
The following annotation preferences are covered:
Display Preferences controlling how and where annotations are shown
as text background highlighting (and respective preference key),
as text decorations (and respective preference key),
on the overview ruler (and respective preference key),
on the overview ruler header,
on the vertical ruler (and respective preference key),
Additional Display Preferences
the base color for annotations of this type (and respective preference key),
the style of text decorations that are drawn (and respective preference
key),
the annotation image provider,
the quick fix image descriptor,
the image descriptor,
the symbolic image name,
the presentation layer.
Navigation Preferences
whether included in the "Go to Next Annotation" navigation action (and
respective preference key),
whether included in the "Go to Previous Annotation" navigation action
(and respective preference key),
whether to be shown in the "Go to Next/Previous Annotation" navigation
toolbar drop down (and respective preference key).
Preference Page Preferences
whether the annotation type should be included on the generic annotation
preference page,
AnnotationPreference(Object annotationType, String colorKey, String textKey, String overviewRulerKey, int presentationLayer) Creates a new annotation preference for the given annotation type.
Method Summary
public boolean
contributesToHeader() Returns whether the annotation type contributes to the header of the overview ruler.
setAnnotationImageProviderData(IConfigurationElement configurationElement, String annotationImageProviderAttribute) Sets the data needed to create the annotation image provider.
setImageDescriptor(ImageDescriptor descriptor) Sets the image descriptor for the image to be drawn in the vertical ruler.
public void
setIncludeOnPreferencePage(boolean includeOnPreferencePage) Sets the property of this annotation preference whether it should be included
on the default annotation preference page.
public void
setIsGoToNextNavigationTarget(boolean isGoToNextNavigationTarget) Sets the default value for go to next navigation enablement.
setQuickFixImageDescriptor(ImageDescriptor descriptor) Sets the Quick Fix image descriptor for the image to be drawn in the vertical ruler.
public void
setSeverity(int severity) Sets the marker severity.
public void
setShowInNextPrevDropdownToolbarAction(boolean showInNextPrevDropdownToolbarAction) Sets the default value for the visibility in the next/previous drop down toolbar action.
Creates a new un-initialized annotation preference. Note that instances
with a null annotation type are invalid and should not be
used.
AnnotationPreference
public AnnotationPreference(Object annotationType, String colorKey, String textKey, String overviewRulerKey, int presentationLayer)(Code)
Creates a new annotation preference for the given annotation type.
Parameters: annotationType - the annotation type Parameters: colorKey - the preference key for the presentation color Parameters: textKey - the preference key for the visibility inside text Parameters: overviewRulerKey - the preference key for the visibility in theoverview ruler Parameters: presentationLayer - the presentation layer
Returns whether the annotation type contributes to the header of the overview ruler.
true if the annotation type contributes to the header of the overview ruler
Returns the annotation image provider. If no default annotation image
provider has been set, this method checks whether the annotation image
provider data has been set. If so, an annotation image provider is
created if the configuration element's plug-in is loaded. When an
annotation image provider has been created successfully, it is set as
the default annotation image provider.
the annotation image provider since: 3.0
Returns the image descriptor for the image to be drawn in the vertical ruler. The provided
image is only used, if getAnnotationImageProvider returns null.
the image descriptor or null since: 3.0
getIntegerValue
protected int getIntegerValue(Object attribute)(Code)
Returns the value of the given attribute as integer.
Parameters: attribute - the attribute the attribute value since: 3.0
Returns the presentation layer.
the presentation layer
getQuickFixImageDescriptor
public ImageDescriptor getQuickFixImageDescriptor()(Code)
Returns the Quick Fix image descriptor for the image to be drawn in the vertical ruler. The provided
image is only used, if getAnnotationImageProvider returns null.
the image descriptor or null since: 3.2
Returns the preference key for the visibility in the next/previous drop down toolbar action.
the preference key or null if the key is undefined since: 3.0
Returns the symbolic name of the image to be drawn in the vertical ruler.
The image is only used if getImageDescriptor returns null.
the symbolic name of the image or null since: 3.0
Returns the preference key for the decoration style used when the annotation is shown in text.
the preference key for the decoration style or null if the key is undefined since: 3.0
Returns the value for the decoration style used when the annotation is shown in text.
the value for the decoration style or null if the key is undefined since: 3.0
Returns the preference key for the visibility in the vertical ruler.
the preference key for the visibility in the vertical ruler ornull if none is set since: 3.0
getVerticalRulerPreferenceValue
public boolean getVerticalRulerPreferenceValue()(Code)
Returns the default visibility in the vertical ruler.
the default visibility in the vertical ruler since: 3.0
Returns the property of the receiver of whether it should be included on
the default annotation preference page.
the includeOnPreferencePage property since: 3.0
Merges the values of the given preference into this preference. Existing
values will not be overwritten. Subclasses may extend.
Parameters: preference - the preference to merge into this preference since: 3.0
Sets the annotation image provider who provides images for annotations
of the specified annotation type.
Parameters: provider - the annotation image provider since: 3.0
setAnnotationImageProviderData
public void setAnnotationImageProviderData(IConfigurationElement configurationElement, String annotationImageProviderAttribute)(Code)
Sets the data needed to create the annotation image provider.
Parameters: configurationElement - the configuration element Parameters: annotationImageProviderAttribute - the attribute of theconfiguration element since: 3.0
setAnnotationType
public void setAnnotationType(Object annotationType)(Code)
Sets the annotation type. Note that instances with a null
annotation type are considered invalid and should not be used with the
framework.
Parameters: annotationType - the annotation type
setColorPreferenceKey
public void setColorPreferenceKey(String colorKey)(Code)
Sets the preference key for the presentation color.
Parameters: colorKey - the preference key
setColorPreferenceValue
public void setColorPreferenceValue(RGB colorValue)(Code)
Sets the default presentation color.
Parameters: colorValue - the default color
setContributesToHeader
public void setContributesToHeader(boolean contributesToHeader)(Code)
Sets whether the annotation type contributes to the overview ruler's header.
Parameters: contributesToHeader - true if in header, false otherwise
setHighlightPreferenceKey
public void setHighlightPreferenceKey(String highlightKey)(Code)
Sets the preference key for highlighting inside text.
Parameters: highlightKey - the preference key since: 3.0
setHighlightPreferenceValue
public void setHighlightPreferenceValue(boolean highlightValue)(Code)
Sets the default value for highlighting inside text.
Parameters: highlightValue - true if highlighted in text by default, false otherwise since: 3.0
setImageDescriptor
public void setImageDescriptor(ImageDescriptor descriptor)(Code)
Sets the image descriptor for the image to be drawn in the vertical ruler.
Parameters: descriptor - the image descriptor since: 3.0
setIncludeOnPreferencePage
public void setIncludeOnPreferencePage(boolean includeOnPreferencePage)(Code)
Sets the property of this annotation preference whether it should be included
on the default annotation preference page.
Parameters: includeOnPreferencePage - the new value since: 3.0
setIsGoToNextNavigationTarget
public void setIsGoToNextNavigationTarget(boolean isGoToNextNavigationTarget)(Code)
Sets the default value for go to next navigation enablement.
Parameters: isGoToNextNavigationTarget - true if enabled by default since: 3.0
setIsGoToNextNavigationTargetKey
public void setIsGoToNextNavigationTargetKey(String isGoToNextNavigationTargetKey)(Code)
Sets the preference key for go to next navigation enablement.
Parameters: isGoToNextNavigationTargetKey - true if enabled by default since: 3.0
setIsGoToPreviousNavigationTarget
public void setIsGoToPreviousNavigationTarget(boolean isGoToPreviousNavigationTarget)(Code)
Sets the default value for go to previous navigation enablement.
Parameters: isGoToPreviousNavigationTarget - true if enabled by default since: 3.0
setIsGoToPreviousNavigationTargetKey
public void setIsGoToPreviousNavigationTargetKey(String isGoToPreviousNavigationTargetKey)(Code)
Sets the preference key for go to previous navigation enablement.
Parameters: isGoToPreviousNavigationTargetKey - the preference key since: 3.0
setMarkerType
public void setMarkerType(String markerType)(Code)
Sets the marker type.
Parameters: markerType - the marker type
setOverviewRulerPreferenceKey
public void setOverviewRulerPreferenceKey(String overviewRulerKey)(Code)
Sets the preference key for the visibility in the overview ruler.
Parameters: overviewRulerKey - the preference key
setOverviewRulerPreferenceValue
public void setOverviewRulerPreferenceValue(boolean overviewRulerValue)(Code)
Sets the default visibility in the overview ruler.
Parameters: overviewRulerValue - true if visible by default, false otherwise
setPreferenceLabel
public void setPreferenceLabel(String label)(Code)
Sets the presentation label of this annotation type.
Parameters: label - the presentation label
setPresentationLayer
public void setPresentationLayer(int presentationLayer)(Code)
Sets the presentation layer.
Parameters: presentationLayer - the presentation layer
setQuickFixImageDescriptor
public void setQuickFixImageDescriptor(ImageDescriptor descriptor)(Code)
Sets the Quick Fix image descriptor for the image to be drawn in the vertical ruler.
Parameters: descriptor - the image descriptor since: 3.2
Sets the marker severity.
Parameters: severity - the marker severity
setShowInNextPrevDropdownToolbarAction
public void setShowInNextPrevDropdownToolbarAction(boolean showInNextPrevDropdownToolbarAction)(Code)
Sets the default value for the visibility in the next/previous drop down toolbar action.
Parameters: showInNextPrevDropdownToolbarAction - true if enabled by default since: 3.0
setShowInNextPrevDropdownToolbarActionKey
public void setShowInNextPrevDropdownToolbarActionKey(String showInNextPrevDropdownToolbarActionKey)(Code)
Sets the preference key for the visibility in the next/previous drop down toolbar action.
Parameters: showInNextPrevDropdownToolbarActionKey - the preference key since: 3.0
setSymbolicImageName
public void setSymbolicImageName(String symbolicImageName)(Code)
Sets the symbolic name of the image to be drawn in the vertical ruler.
Parameters: symbolicImageName - the symbolic image name since: 3.0
setTextPreferenceKey
public void setTextPreferenceKey(String textKey)(Code)
Sets the preference key for the visibility of squiggles inside text.
Parameters: textKey - the preference key
setTextPreferenceValue
public void setTextPreferenceValue(boolean textValue)(Code)
Sets the default visibility inside text.
Parameters: textValue - true if visible by default, false otherwise
setTextStylePreferenceKey
public void setTextStylePreferenceKey(String key)(Code)
Sets the preference key for the text style property.
Parameters: key - the new key since: 3.0