Class JavaSourceViewerConfiguration
This class may be instantiated; it is not intended to be subclassed.
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.static final String
Deprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHAR
Fields inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
fPreferenceStore
-
Constructor Summary
ConstructorDescriptionJavaSourceViewerConfiguration
(IColorManager colorManager, org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.ui.texteditor.ITextEditor editor, String partitioning) Creates a new Java source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.JavaSourceViewerConfiguration
(IColorManager colorManager, org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.ui.texteditor.ITextEditor editor, String partitioning, boolean isModuleInfo) Creates a new Java source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.JavaSourceViewerConfiguration
(JavaTextTools tools, org.eclipse.ui.texteditor.ITextEditor editor) Deprecated.As of 3.0, replaced byJavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
affectsTextPresentation
(org.eclipse.jface.util.PropertyChangeEvent event) Determines whether the preference change encoded by the given event changes the behavior of one of its contained components.org.eclipse.jface.text.source.IAnnotationHover
getAnnotationHover
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.IAutoEditStrategy[]
getAutoEditStrategies
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) protected org.eclipse.jface.text.rules.RuleBasedScanner
Returns the Java source code scanner for this configuration.protected IColorManager
Returns the color manager for this configuration.String[]
getConfiguredContentTypes
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) getConfiguredDocumentPartitioning
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) int[]
getConfiguredTextHoverStateMasks
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.contentassist.IContentAssistant
getContentAssistant
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.formatter.IContentFormatter
getContentFormatter
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) String[]
getDefaultPrefixes
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.ITextDoubleClickStrategy
getDoubleClickStrategy
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) protected org.eclipse.ui.texteditor.ITextEditor
Returns the editor in which the configured viewer(s) will reside.org.eclipse.jface.text.information.IInformationPresenter
getHierarchyPresenter
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, boolean doCodeResolve) Returns the hierarchy presenter which will determine and shown type hierarchy information requested for the current cursor position.getHyperlinkDetectorTargets
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) String[]
getIndentPrefixes
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.IInformationControlCreator
getInformationControlCreator
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.information.IInformationPresenter
getInformationPresenter
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.text.rules.RuleBasedScanner
Returns the JavaDoc scanner for this configuration.protected org.eclipse.jface.text.rules.RuleBasedScanner
Returns the Java multi-line comment scanner for this configuration.org.eclipse.jface.text.information.IInformationPresenter
getOutlinePresenter
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, boolean doCodeResolve) Returns the outline presenter which will determine and shown information requested for the current cursor position.org.eclipse.jface.text.source.IAnnotationHover
getOverviewRulerAnnotationHover
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.preference.IPreferenceStore
Deprecated.As of 3.0org.eclipse.jface.text.presentation.IPresentationReconciler
getPresentationReconciler
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.quickassist.IQuickAssistAssistant
getQuickAssistAssistant
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.reconciler.IReconciler
getReconciler
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.text.rules.RuleBasedScanner
Returns the Java single-line comment scanner for this configuration.protected org.eclipse.jface.text.rules.RuleBasedScanner
Returns the Java string scanner for this configuration.int
getTabWidth
(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.ITextHover
getTextHover
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.ITextHover
getTextHover
(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType, int stateMask) void
handlePropertyChangeEvent
(org.eclipse.jface.util.PropertyChangeEvent event) Adapts the behavior of the contained components to the change encoded in the given event.Methods inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
computeStateMask, findLocalizedModifier, getHyperlinkDetectors, getHyperlinkPresenter, getHyperlinkStateMask, getLineSpacing, getRegisteredHyperlinkDetectors, getUndoManager, isShowInOverviewRuler, isShowInVerticalRuler, isShownInText
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoIndentStrategy, getCodeMiningProviders, getIndentPrefixesForTab
-
Field Details
-
PREFERENCE_TAB_WIDTH
Deprecated.As of 3.0, replaced byAbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH
Preference key used to look up display tab width.- Since:
- 2.0
- See Also:
-
SPACES_FOR_TABS
Deprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHAR
Preference key for inserting spaces rather than tabs.- Since:
- 2.0
- See Also:
-
-
Constructor Details
-
JavaSourceViewerConfiguration
public JavaSourceViewerConfiguration(IColorManager colorManager, org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.ui.texteditor.ITextEditor editor, String partitioning) Creates a new Java source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.Creates a Java source viewer configuration in the new setup without text tools. Clients are allowed to call
handlePropertyChangeEvent(PropertyChangeEvent)
and disallowed to callgetPreferenceStore()
on the resulting Java source viewer configuration.- Parameters:
colorManager
- the color managerpreferenceStore
- the preference store, can be read-onlyeditor
- the editor in which the configured viewer(s) will reside, ornull
if nonepartitioning
- the document partitioning for this configuration, ornull
for the default partitioning- Since:
- 3.0
-
JavaSourceViewerConfiguration
public JavaSourceViewerConfiguration(IColorManager colorManager, org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.ui.texteditor.ITextEditor editor, String partitioning, boolean isModuleInfo) Creates a new Java source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.Creates a Java source viewer configuration in the new setup without text tools. Clients are allowed to call
handlePropertyChangeEvent(PropertyChangeEvent)
and disallowed to callgetPreferenceStore()
on the resulting Java source viewer configuration.- Parameters:
colorManager
- the color managerpreferenceStore
- the preference store, can be read-onlyeditor
- the editor in which the configured viewer(s) will reside, ornull
if nonepartitioning
- the document partitioning for this configuration, ornull
for the default partitioningisModuleInfo
-true
ifJavaCodeScanner
should be initialized for module-info code- Since:
- 3.14
-
JavaSourceViewerConfiguration
@Deprecated public JavaSourceViewerConfiguration(JavaTextTools tools, org.eclipse.ui.texteditor.ITextEditor editor) Deprecated.As of 3.0, replaced byJavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)
Creates a new Java source viewer configuration for viewers in the given editor using the given Java tools.- Parameters:
tools
- the Java text tools to be usededitor
- the editor in which the configured viewer(s) will reside, ornull
if none- See Also:
-
-
Method Details
-
getCodeScanner
protected org.eclipse.jface.text.rules.RuleBasedScanner getCodeScanner()Returns the Java source code scanner for this configuration.- Returns:
- the Java source code scanner
-
getMultilineCommentScanner
protected org.eclipse.jface.text.rules.RuleBasedScanner getMultilineCommentScanner()Returns the Java multi-line comment scanner for this configuration.- Returns:
- the Java multi-line comment scanner
- Since:
- 2.0
-
getSinglelineCommentScanner
protected org.eclipse.jface.text.rules.RuleBasedScanner getSinglelineCommentScanner()Returns the Java single-line comment scanner for this configuration.- Returns:
- the Java single-line comment scanner
- Since:
- 2.0
-
getStringScanner
protected org.eclipse.jface.text.rules.RuleBasedScanner getStringScanner()Returns the Java string scanner for this configuration.- Returns:
- the Java string scanner
- Since:
- 2.0
-
getJavaDocScanner
protected org.eclipse.jface.text.rules.RuleBasedScanner getJavaDocScanner()Returns the JavaDoc scanner for this configuration.- Returns:
- the JavaDoc scanner
-
getColorManager
Returns the color manager for this configuration.- Returns:
- the color manager
-
getEditor
protected org.eclipse.ui.texteditor.ITextEditor getEditor()Returns the editor in which the configured viewer(s) will reside.- Returns:
- the enclosing editor
-
getPreferenceStore
Deprecated.As of 3.0Returns the preference store used by this configuration to initialize the individual bits and pieces.Clients are not allowed to call this method if the new setup without text tools is in use.
- Returns:
- the preference store used to initialize this configuration
- Since:
- 2.0
- See Also:
-
getPresentationReconciler
public org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getPresentationReconciler
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getContentAssistant
public org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getContentAssistant
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getQuickAssistAssistant
public org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getQuickAssistAssistant
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getReconciler
public org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getReconciler
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getAutoEditStrategies
public org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getAutoEditStrategies
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getDoubleClickStrategy
public org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getDoubleClickStrategy
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getDefaultPrefixes
public String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getDefaultPrefixes
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getIndentPrefixes
public String[] getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getIndentPrefixes
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getTabWidth
public int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getTabWidth
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getAnnotationHover
public org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getAnnotationHover
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getOverviewRulerAnnotationHover
public org.eclipse.jface.text.source.IAnnotationHover getOverviewRulerAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getOverviewRulerAnnotationHover
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getConfiguredTextHoverStateMasks
public int[] getConfiguredTextHoverStateMasks(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getConfiguredTextHoverStateMasks
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getTextHover
public org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType, int stateMask) - Overrides:
getTextHover
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getTextHover
public org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
getTextHover
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
getConfiguredContentTypes
- Overrides:
getConfiguredContentTypes
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getConfiguredDocumentPartitioning
public String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getConfiguredDocumentPartitioning
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getContentFormatter
public org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getContentFormatter
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getInformationControlCreator
public org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getInformationControlCreator
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getInformationPresenter
public org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getInformationPresenter
in classorg.eclipse.jface.text.source.SourceViewerConfiguration
-
getOutlinePresenter
public org.eclipse.jface.text.information.IInformationPresenter getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer, boolean doCodeResolve) Returns the outline presenter which will determine and shown information requested for the current cursor position.- Parameters:
sourceViewer
- the source viewer to be configured by this configurationdoCodeResolve
- a boolean which specifies whether code resolve should be used to compute the Java element- Returns:
- an information presenter
- Since:
- 2.1
-
getHierarchyPresenter
public org.eclipse.jface.text.information.IInformationPresenter getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer, boolean doCodeResolve) Returns the hierarchy presenter which will determine and shown type hierarchy information requested for the current cursor position.- Parameters:
sourceViewer
- the source viewer to be configured by this configurationdoCodeResolve
- a boolean which specifies whether code resolve should be used to compute the Java element- Returns:
- an information presenter
- Since:
- 3.0
-
affectsTextPresentation
public boolean affectsTextPresentation(org.eclipse.jface.util.PropertyChangeEvent event) Determines whether the preference change encoded by the given event changes the behavior of one of its contained components.- Parameters:
event
- the event to be investigated- Returns:
true
if event causes a behavioral change- Since:
- 3.0
-
handlePropertyChangeEvent
public void handlePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent event) Adapts the behavior of the contained components to the change encoded in the given event.Clients are not allowed to call this method if the old setup with text tools is in use.
- Parameters:
event
- the event to which to adapt- Since:
- 3.0
- See Also:
-
getHyperlinkDetectorTargets
protected Map<String,org.eclipse.core.runtime.IAdaptable> getHyperlinkDetectorTargets(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
getHyperlinkDetectorTargets
in classorg.eclipse.ui.editors.text.TextSourceViewerConfiguration
-
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH