public class SourceViewerDecorationSupport extends Object
Once configured, an instance may be installed (see
install
) on a preference store, from then
on monitoring the configured preference settings and changing the respective
decorations. Calling uninstall
will unregister the
listeners with the preferences store and must be called before changing the
preference store by another call to install
.
dispose
will uninstall the support and remove any
decorations from the viewer. It is okay to reuse a
SourceViewerDecorationSupport
instance after disposing it.
SourceViewerDecorationSupport
can draw the following
decorations:
AnnotationPainter
instance.
Subclasses may add decorations but should adhere to the lifecyle described above.
AnnotationPainter
Constructor and Description |
---|
SourceViewerDecorationSupport(ISourceViewer sourceViewer,
IOverviewRuler overviewRuler,
IAnnotationAccess annotationAccess,
ISharedTextColors sharedTextColors)
Creates a new decoration support for the given viewer.
|
Modifier and Type | Method and Description |
---|---|
protected AnnotationPainter |
createAnnotationPainter()
Creates and configures the annotation painter and configures.
|
void |
dispose()
Disposes this decoration support.
|
protected void |
handlePreferenceStoreChanged(PropertyChangeEvent event) |
void |
hideAnnotationOverview()
Hides the annotation overview.
|
void |
install(IPreferenceStore store)
Installs this decoration support on the given preference store.
|
void |
setAnnotationPainterPreferenceKeys(Object type,
String colorKey,
String editorKey,
String overviewRulerKey,
int layer)
Sets the preference keys for the annotation painter.
|
void |
setAnnotationPreference(AnnotationPreference info)
Sets the preference info for the annotation painter.
|
void |
setCharacterPairMatcher(ICharacterPairMatcher pairMatcher)
Sets the character pair matcher for the matching character painter.
|
void |
setCursorLinePainterPreferenceKeys(String enableKey,
String colorKey)
Sets the preference keys for the cursor line painter.
|
void |
setMarginPainterPreferenceKeys(String enableKey,
String colorKey,
String columnKey)
Sets the preference keys for the margin painter.
|
void |
setMatchingCharacterPainterPreferenceKeys(String enableKey,
String colorKey)
Sets the preference keys for the matching character painter.
|
void |
setMatchingCharacterPainterPreferenceKeys(String enableKey,
String colorKey,
String highlightCharacterAtCaretLocationKey,
String enclosingPeerCharactersKey)
Sets the preference keys for the matching character painter.
|
void |
setSymbolicFontName(String symbolicFontName)
Sets the symbolic font name that is used for computing the margin width.
|
void |
uninstall()
Uninstalls this support from the preference store it has previously been
installed on.
|
void |
updateOverviewDecorations()
Updates the annotation overview for all configured annotation types.
|
public SourceViewerDecorationSupport(ISourceViewer sourceViewer, IOverviewRuler overviewRuler, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors)
sourceViewer
- the source vieweroverviewRuler
- the viewer's overview rulerannotationAccess
- the annotation accesssharedTextColors
- the shared text color managerpublic void install(IPreferenceStore store)
store
- the preference storepublic void updateOverviewDecorations()
public void uninstall()
public void dispose()
uninstall
.public void setCharacterPairMatcher(ICharacterPairMatcher pairMatcher)
pairMatcher
- the character pair matcherpublic void setAnnotationPainterPreferenceKeys(Object type, String colorKey, String editorKey, String overviewRulerKey, int layer)
type
- the annotation typecolorKey
- the preference key for the coloreditorKey
- the preference key for the presentation in the text areaoverviewRulerKey
- the preference key for the presentation in the overview rulerlayer
- the layerpublic void setAnnotationPreference(AnnotationPreference info)
info
- the preference info to be setpublic void setCursorLinePainterPreferenceKeys(String enableKey, String colorKey)
enableKey
- the preference key for the cursor line paintercolorKey
- the preference key for the color used by the cursor line
painterpublic void setMarginPainterPreferenceKeys(String enableKey, String colorKey, String columnKey)
enableKey
- the preference key for the margin paintercolorKey
- the preference key for the color used by the margin
paintercolumnKey
- the preference key for the margin columnpublic void setMatchingCharacterPainterPreferenceKeys(String enableKey, String colorKey)
Use setMatchingCharacterPainterPreferenceKeys(String, String, String, String)
if
highlighting of character at caret location or enclosing peer characters is required.
enableKey
- the preference key for the matching character paintercolorKey
- the preference key for the color used by the matching character painterpublic void setMatchingCharacterPainterPreferenceKeys(String enableKey, String colorKey, String highlightCharacterAtCaretLocationKey, String enclosingPeerCharactersKey)
enableKey
- the preference key for the matching character paintercolorKey
- the preference key for the color used by the matching character painterhighlightCharacterAtCaretLocationKey
- the preference key for highlighting character at
caret locationenclosingPeerCharactersKey
- the preference key for highlighting enclosing peer
characterspublic void setSymbolicFontName(String symbolicFontName)
symbolicFontName
- the symbolic font nameprotected void handlePreferenceStoreChanged(PropertyChangeEvent event)
protected AnnotationPainter createAnnotationPainter()
public void hideAnnotationOverview()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.