Package org.eclipse.ui.editors.text
Class TextSourceViewerConfiguration
java.lang.Object
org.eclipse.jface.text.source.SourceViewerConfiguration
org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Source viewer configuration for the text editor.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IPreferenceStoreThe preference store used to initialize this configuration. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a text source viewer configuration.TextSourceViewerConfiguration(IPreferenceStore preferenceStore) Creates a text source viewer configuration and initializes it with the given preference store. -
Method Summary
Modifier and TypeMethodDescriptionprotected static final intcomputeStateMask(String modifiers) Computes the state mask out of the given modifiers string.protected static final intfindLocalizedModifier(String modifierName) Maps the localized modifier name to a code in the same manner as #findModifier.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.getHyperlinkDetectors(ISourceViewer sourceViewer) Returns the hyperlink detectors which be used to detect hyperlinks in the given source viewer.protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) Returns the hyperlink detector targets supported by the given source viewer.getHyperlinkPresenter(ISourceViewer sourceViewer) Returns the hyperlink presenter for the given source viewer.intgetHyperlinkStateMask(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.intgetLineSpacing(ISourceViewer sourceViewer) Returns the lineSpacing for the given source viewer.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 bygetAnnotationHover.getQuickAssistAssistant(ISourceViewer sourceViewer) Returns the quick assist assistant ready to be used with the given source viewer.getReconciler(ISourceViewer sourceViewer) Returns the reconciler ready to be used with the given source viewer.protected final IHyperlinkDetector[]getRegisteredHyperlinkDetectors(ISourceViewer sourceViewer) Returns the registered hyperlink detectors which are used to detect hyperlinks in the given source viewer.intgetTabWidth(ISourceViewer sourceViewer) Returns the visual width of the tab character.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.getUndoManager(ISourceViewer sourceViewer) Returns the undo manager for the given source viewer.protected booleanisShowInOverviewRuler(Annotation annotation) protected booleanisShowInVerticalRuler(Annotation annotation) protected booleanisShownInText(Annotation annotation) Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoEditStrategies, getAutoIndentStrategy, getCodeMiningProviders, getConfiguredContentTypes, getConfiguredDocumentPartitioning, getContentAssistant, getContentFormatter, getDefaultPrefixes, getDoubleClickStrategy, getIndentPrefixesForTab, getInformationControlCreator, getInformationPresenter, getPresentationReconciler, getTextHover
-
Field Details
-
fPreferenceStore
The preference store used to initialize this configuration.Note: protected since 3.1
-
-
Constructor Details
-
TextSourceViewerConfiguration
public TextSourceViewerConfiguration()Creates a text source viewer configuration. -
TextSourceViewerConfiguration
Creates a text source viewer configuration and initializes it with the given preference store.- Parameters:
preferenceStore- the preference store used to initialize this configuration
-
-
Method Details
-
getAnnotationHover
Description copied from class:SourceViewerConfigurationReturns the annotation hover which will provide the information to be shown in a hover popup window when requested for the given source viewer. This implementation always returnsnull.- Overrides:
getAnnotationHoverin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- an annotation hover or
nullif no hover support should be installed
-
isShowInVerticalRuler
-
getOverviewRulerAnnotationHover
Description copied from class:SourceViewerConfigurationReturns 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 bygetAnnotationHover.- Overrides:
getOverviewRulerAnnotationHoverin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- an annotation hover or
nullif no hover support should be installed
-
isShowInOverviewRuler
-
getConfiguredTextHoverStateMasks
Description copied from class:SourceViewerConfigurationReturns the SWT event state masks for which text hover are configured for the given content type.- Overrides:
getConfiguredTextHoverStateMasksin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configurationcontentType- the content type- Returns:
- an
intarray with the configured SWT event state masks ornullif text hovers are not supported for the given content type
-
getTextHover
Description copied from class:SourceViewerConfigurationReturns 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. This implementation always returnsnull.- Overrides:
getTextHoverin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configurationcontentType- the content type- Returns:
- a text hover or
nullif no hover support should be installed
-
isShownInText
-
getTabWidth
Description copied from class:SourceViewerConfigurationReturns the visual width of the tab character. This implementation always returns 4.- Overrides:
getTabWidthin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- the tab width
-
getLineSpacing
Returns the lineSpacing for the given source viewer.- Overrides:
getLineSpacingin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- the lineSpacing
- Since:
- 3.15
- See Also:
-
getIndentPrefixes
Description copied from class:SourceViewerConfigurationReturns the prefixes to be used by the line-shift operation. This implementation always returnsnew 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.- Overrides:
getIndentPrefixesin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configurationcontentType- the content type for which the prefix is applicable- Returns:
- the prefixes or
nullif the prefix operation should not be supported
-
getHyperlinkDetectors
Description copied from class:SourceViewerConfigurationReturns the hyperlink detectors which be used to detect hyperlinks in the given source viewer. This implementation always returns an array with an URL hyperlink detector.- Overrides:
getHyperlinkDetectorsin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- an array with hyperlink detectors or
nullif no hyperlink support should be installed
-
getRegisteredHyperlinkDetectors
Returns the registered hyperlink detectors which are used to detect hyperlinks in the given source viewer.- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- an array with hyperlink detectors or
nullif no hyperlink detectors are registered - Since:
- 3.3
-
getHyperlinkDetectorTargets
Returns the hyperlink detector targets supported by the given source viewer.Subclasses are allowed to modify the returned map.
- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- the hyperlink detector targets with target id (
String) as key and the target context (IAdaptable) as value - Since:
- 3.3
-
getHyperlinkStateMask
Description copied from class:SourceViewerConfigurationReturns the SWT event state mask which in combination with the left mouse button activates hyperlinking. This implementation always returns theSWT.MOD1.- Overrides:
getHyperlinkStateMaskin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- the SWT event state mask to activate hyperlink mode
-
getHyperlinkPresenter
Description copied from class:SourceViewerConfigurationReturns the hyperlink presenter for the given source viewer. This implementation always returns theDefaultHyperlinkPresenter.- Overrides:
getHyperlinkPresenterin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- the hyperlink presenter or
nullif no hyperlink support should be installed
-
findLocalizedModifier
Maps the localized modifier name to a code in the same manner as #findModifier.- Parameters:
modifierName- the modifier name- Returns:
- the SWT modifier bit, or
0if no match was found - Since:
- 3.1
-
computeStateMask
Computes the state mask out of the given modifiers string.- Parameters:
modifiers- a string containing modifiers- Returns:
- the state mask
- Since:
- 3.1
-
getUndoManager
Description copied from class:SourceViewerConfigurationReturns the undo manager for the given source viewer. This implementation always returns a new instance ofDefaultUndoManagerwhose history length is set to 25.- Overrides:
getUndoManagerin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- an undo manager or
nullif no undo/redo should not be supported
-
getReconciler
Returns the reconciler ready to be used with the given source viewer.This implementation currently returns a
MonoReconcilerwhich is responsible for spell checking. In the future a different reconciler taking over more responsibilities might be returned.- Overrides:
getReconcilerin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- a reconciler or
nullif reconciling should not be supported - Since:
- 3.3
- See Also:
-
getQuickAssistAssistant
Description copied from class:SourceViewerConfigurationReturns the quick assist assistant ready to be used with the given source viewer. This implementation always returnsnull.- Overrides:
getQuickAssistAssistantin classSourceViewerConfiguration- Parameters:
sourceViewer- the source viewer to be configured by this configuration- Returns:
- a quick assist assistant or
nullif quick assist should not be supported
-