public class TextSourceViewerConfiguration extends SourceViewerConfiguration
Modifier and Type | Field and Description |
---|---|
protected IPreferenceStore |
fPreferenceStore
The preference store used to initialize this configuration.
|
Constructor and Description |
---|
TextSourceViewerConfiguration()
Creates a text source viewer configuration.
|
TextSourceViewerConfiguration(IPreferenceStore preferenceStore)
Creates a text source viewer configuration and
initializes it with the given preference store.
|
Modifier and Type | Method and Description |
---|---|
protected static int |
computeStateMask(String modifiers)
Computes the state mask out of the given modifiers string.
|
protected static int |
findLocalizedModifier(String modifierName)
Maps the localized modifier name to a code in the same
manner as #findModifier.
|
IAnnotationHover |
getAnnotationHover(ISourceViewer sourceViewer)
Returns the annotation hover which will provide the information to be
shown in a hover popup window when requested for the given
source viewer.
|
int[] |
getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer,
String contentType)
Returns the SWT event state masks for which text hover are configured for
the given content type.
|
IHyperlinkDetector[] |
getHyperlinkDetectors(ISourceViewer sourceViewer)
Returns the hyperlink detectors which be used to detect hyperlinks
in the given source viewer.
|
protected Map |
getHyperlinkDetectorTargets(ISourceViewer sourceViewer)
Returns the hyperlink detector targets supported by the
given source viewer.
|
IHyperlinkPresenter |
getHyperlinkPresenter(ISourceViewer sourceViewer)
Returns the hyperlink presenter for the given source viewer.
|
int |
getHyperlinkStateMask(ISourceViewer sourceViewer)
Returns the SWT event state mask which in combination
with the left mouse button activates hyperlinking.
|
String[] |
getIndentPrefixes(ISourceViewer sourceViewer,
String contentType)
Returns the prefixes to be used by the line-shift operation.
|
IAnnotationHover |
getOverviewRulerAnnotationHover(ISourceViewer sourceViewer)
Returns the annotation hover which will provide the information to be
shown in a hover popup window when requested for the overview ruler
of the given source viewer.This implementation always returns the general
annotation hover returned by
getAnnotationHover . |
IQuickAssistAssistant |
getQuickAssistAssistant(ISourceViewer sourceViewer)
Returns the quick assist assistant ready to be used with the given
source viewer.
|
IReconciler |
getReconciler(ISourceViewer sourceViewer)
Returns the reconciler ready to be used with the given source viewer.
|
protected IHyperlinkDetector[] |
getRegisteredHyperlinkDetectors(ISourceViewer sourceViewer)
Returns the registered hyperlink detectors which are used to detect
hyperlinks in the given source viewer.
|
int |
getTabWidth(ISourceViewer sourceViewer)
Returns the visual width of the tab character.
|
ITextHover |
getTextHover(ISourceViewer sourceViewer,
String contentType)
Returns the text hover which will provide the information to be shown
in a text hover popup window when requested for the given source viewer and
the given content type.
|
IUndoManager |
getUndoManager(ISourceViewer sourceViewer)
Returns the undo manager for the given source viewer.
|
protected boolean |
isShowInOverviewRuler(Annotation annotation) |
protected boolean |
isShowInVerticalRuler(Annotation annotation) |
protected boolean |
isShownInText(Annotation annotation) |
getAutoEditStrategies, getAutoIndentStrategy, getConfiguredContentTypes, getConfiguredDocumentPartitioning, getContentAssistant, getContentFormatter, getDefaultPrefixes, getDoubleClickStrategy, getIndentPrefixesForTab, getInformationControlCreator, getInformationPresenter, getPresentationReconciler, getTextHover
protected IPreferenceStore fPreferenceStore
Note: protected since 3.1
public TextSourceViewerConfiguration()
public TextSourceViewerConfiguration(IPreferenceStore preferenceStore)
preferenceStore
- the preference store used to initialize this configurationpublic IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
SourceViewerConfiguration
null
.getAnnotationHover
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if no hover support should be installedprotected boolean isShowInVerticalRuler(Annotation annotation)
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer)
SourceViewerConfiguration
getAnnotationHover
.getOverviewRulerAnnotationHover
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if no hover support should be installedprotected boolean isShowInOverviewRuler(Annotation annotation)
public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType)
SourceViewerConfiguration
getConfiguredTextHoverStateMasks
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationcontentType
- the content typeint
array with the configured SWT event state masks
or null
if text hovers are not supported for the given content typepublic ITextHover getTextHover(ISourceViewer sourceViewer, String contentType)
SourceViewerConfiguration
null
.getTextHover
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationcontentType
- the content typenull
if no hover support should be installedprotected boolean isShownInText(Annotation annotation)
public int getTabWidth(ISourceViewer sourceViewer)
SourceViewerConfiguration
getTabWidth
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationpublic String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType)
SourceViewerConfiguration
new String[] { "\t", " ", "" }
.
Note: This default is incorrect but cannot be changed in order not
to break any existing clients. Subclasses should overwrite this method and
use SourceViewerConfiguration.getIndentPrefixesForTab(int)
if applicable.
getIndentPrefixes
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationcontentType
- the content type for which the prefix is applicablenull
if the prefix operation should not be supportedpublic IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer)
SourceViewerConfiguration
getHyperlinkDetectors
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if no hyperlink support should be installedprotected final IHyperlinkDetector[] getRegisteredHyperlinkDetectors(ISourceViewer sourceViewer)
sourceViewer
- the source viewer to be configured by this configurationnull
if no hyperlink detectors are registeredprotected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer)
Subclasses are allowed to modify the returned map.
sourceViewer
- the source viewer to be configured by this configurationString
) as key
and the target context (IAdaptable
) as valuepublic int getHyperlinkStateMask(ISourceViewer sourceViewer)
SourceViewerConfiguration
SWT.MOD1
.getHyperlinkStateMask
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationpublic IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer)
SourceViewerConfiguration
DefaultHyperlinkPresenter
.getHyperlinkPresenter
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if no hyperlink support should be installedprotected static final int findLocalizedModifier(String modifierName)
modifierName
- the modifier name0
if no match was foundprotected static final int computeStateMask(String modifiers)
modifiers
- a string containing modifierspublic IUndoManager getUndoManager(ISourceViewer sourceViewer)
SourceViewerConfiguration
DefaultUndoManager
whose
history length is set to 25.getUndoManager
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if no undo/redo should not be supportedpublic IReconciler getReconciler(ISourceViewer sourceViewer)
This implementation currently returns a MonoReconciler
which
is responsible for spell checking. In the future a different reconciler
taking over more responsibilities might be returned.
getReconciler
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if reconciling should not be supportedSourceViewerConfiguration.getReconciler(org.eclipse.jface.text.source.ISourceViewer)
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer)
SourceViewerConfiguration
null
.getQuickAssistAssistant
in class SourceViewerConfiguration
sourceViewer
- the source viewer to be configured by this configurationnull
if quick assist should not be supported
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.