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 SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final StringDeprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHARFields inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfigurationfPreferenceStore
- 
Constructor SummaryConstructorsConstructorDescriptionJavaSourceViewerConfiguration(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 SummaryModifier and TypeMethodDescriptionbooleanaffectsTextPresentation(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.IAnnotationHovergetAnnotationHover(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.RuleBasedScannerReturns the Java source code scanner for this configuration.protected IColorManagerReturns 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.IContentAssistantgetContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.formatter.IContentFormattergetContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) String[]getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.ITextDoubleClickStrategygetDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) protected org.eclipse.ui.texteditor.ITextEditorReturns the editor in which the configured viewer(s) will reside.org.eclipse.jface.text.information.IInformationPresentergetHierarchyPresenter(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.IInformationControlCreatorgetInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.information.IInformationPresentergetInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.text.rules.RuleBasedScannerReturns the JavaDoc scanner for this configuration.protected org.eclipse.jface.text.rules.RuleBasedScannerReturns the Java multi-line comment scanner for this configuration.org.eclipse.jface.text.information.IInformationPresentergetOutlinePresenter(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.IAnnotationHovergetOverviewRulerAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.preference.IPreferenceStoreDeprecated.As of 3.0org.eclipse.jface.text.presentation.IPresentationReconcilergetPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.quickassist.IQuickAssistAssistantgetQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.reconciler.IReconcilergetReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) protected org.eclipse.jface.text.rules.RuleBasedScannerReturns the Java single-line comment scanner for this configuration.protected org.eclipse.jface.text.rules.RuleBasedScannerReturns the Java string scanner for this configuration.intgetTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer) org.eclipse.jface.text.ITextHovergetTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) org.eclipse.jface.text.ITextHovergetTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType, int stateMask) voidhandlePropertyChangeEvent(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.TextSourceViewerConfigurationcomputeStateMask, findLocalizedModifier, getHyperlinkDetectors, getHyperlinkPresenter, getHyperlinkStateMask, getLineSpacing, getRegisteredHyperlinkDetectors, getUndoManager, isShowInOverviewRuler, isShowInVerticalRuler, isShownInTextMethods inherited from class org.eclipse.jface.text.source.SourceViewerConfigurationgetAutoIndentStrategy, getCodeMiningProviders, getIndentPrefixesForTab
- 
Field Details- 
PREFERENCE_TAB_WIDTHDeprecated.As of 3.0, replaced byAbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTHPreference key used to look up display tab width.- Since:
- 2.0
- See Also:
 
- 
SPACES_FOR_TABSDeprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHARPreference key for inserting spaces rather than tabs.- Since:
- 2.0
- See Also:
 
 
- 
- 
Constructor Details- 
JavaSourceViewerConfigurationpublic 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 manager
- preferenceStore- the preference store, can be read-only
- editor- the editor in which the configured viewer(s) will reside, or- nullif none
- partitioning- the document partitioning for this configuration, or- nullfor the default partitioning
- Since:
- 3.0
 
- 
JavaSourceViewerConfigurationpublic 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 manager
- preferenceStore- the preference store, can be read-only
- editor- the editor in which the configured viewer(s) will reside, or- nullif none
- partitioning- the document partitioning for this configuration, or- nullfor the default partitioning
- isModuleInfo-- trueif- JavaCodeScannershould 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 used
- editor- the editor in which the configured viewer(s) will reside, or- nullif none
- See Also:
 
 
- 
- 
Method Details- 
getCodeScannerprotected org.eclipse.jface.text.rules.RuleBasedScanner getCodeScanner()Returns the Java source code scanner for this configuration.- Returns:
- the Java source code scanner
 
- 
getMultilineCommentScannerprotected 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
 
- 
getSinglelineCommentScannerprotected 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
 
- 
getStringScannerprotected org.eclipse.jface.text.rules.RuleBasedScanner getStringScanner()Returns the Java string scanner for this configuration.- Returns:
- the Java string scanner
- Since:
- 2.0
 
- 
getJavaDocScannerprotected org.eclipse.jface.text.rules.RuleBasedScanner getJavaDocScanner()Returns the JavaDoc scanner for this configuration.- Returns:
- the JavaDoc scanner
 
- 
getColorManagerReturns the color manager for this configuration.- Returns:
- the color manager
 
- 
getEditorprotected org.eclipse.ui.texteditor.ITextEditor getEditor()Returns the editor in which the configured viewer(s) will reside.- Returns:
- the enclosing editor
 
- 
getPreferenceStoreDeprecated.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:
 
- 
getPresentationReconcilerpublic org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getPresentationReconcilerin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getContentAssistantpublic org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getContentAssistantin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getQuickAssistAssistantpublic org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getQuickAssistAssistantin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getReconcilerpublic org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getReconcilerin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getAutoEditStrategiespublic org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getAutoEditStrategiesin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getDoubleClickStrategypublic org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getDoubleClickStrategyin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getDefaultPrefixespublic String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getDefaultPrefixesin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getIndentPrefixespublic String[] getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getIndentPrefixesin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getTabWidthpublic int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getTabWidthin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getAnnotationHoverpublic org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getAnnotationHoverin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getOverviewRulerAnnotationHoverpublic org.eclipse.jface.text.source.IAnnotationHover getOverviewRulerAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getOverviewRulerAnnotationHoverin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getConfiguredTextHoverStateMaskspublic int[] getConfiguredTextHoverStateMasks(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getConfiguredTextHoverStateMasksin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getTextHoverpublic org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType, int stateMask) - Overrides:
- getTextHoverin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getTextHoverpublic org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, String contentType) - Overrides:
- getTextHoverin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
- 
getConfiguredContentTypes- Overrides:
- getConfiguredContentTypesin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getConfiguredDocumentPartitioningpublic String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getConfiguredDocumentPartitioningin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getContentFormatterpublic org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getContentFormatterin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getInformationControlCreatorpublic org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getInformationControlCreatorin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getInformationPresenterpublic org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getInformationPresenterin class- org.eclipse.jface.text.source.SourceViewerConfiguration
 
- 
getOutlinePresenterpublic 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 configuration
- doCodeResolve- a boolean which specifies whether code resolve should be used to compute the Java element
- Returns:
- an information presenter
- Since:
- 2.1
 
- 
getHierarchyPresenterpublic 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 configuration
- doCodeResolve- a boolean which specifies whether code resolve should be used to compute the Java element
- Returns:
- an information presenter
- Since:
- 3.0
 
- 
affectsTextPresentationpublic 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:
- trueif event causes a behavioral change
- Since:
- 3.0
 
- 
handlePropertyChangeEventpublic 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:
 
- 
getHyperlinkDetectorTargetsprotected Map<String,org.eclipse.core.runtime.IAdaptable> getHyperlinkDetectorTargets(org.eclipse.jface.text.source.ISourceViewer sourceViewer) - Overrides:
- getHyperlinkDetectorTargetsin class- org.eclipse.ui.editors.text.TextSourceViewerConfiguration
 
 
- 
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH