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
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final StringDeprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHARFields inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
fPreferenceStore -
Constructor Summary
ConstructorsConstructorDescriptionJavaSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, 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, IPreferenceStore preferenceStore, 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, ITextEditor editor) Deprecated.As of 3.0, replaced byJavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the preference change encoded by the given event changes the behavior of one of its contained components.getAnnotationHover(ISourceViewer sourceViewer) getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) protected RuleBasedScannerReturns the Java source code scanner for this configuration.protected IColorManagerReturns the color manager for this configuration.String[]getConfiguredContentTypes(ISourceViewer sourceViewer) getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) int[]getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) getContentAssistant(ISourceViewer sourceViewer) getContentFormatter(ISourceViewer sourceViewer) String[]getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) protected ITextEditorReturns the editor in which the configured viewer(s) will reside.getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) Returns the hierarchy presenter which will determine and shown type hierarchy information requested for the current cursor position.protected Map<String,IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) String[]getIndentPrefixes(ISourceViewer sourceViewer, String contentType) getInformationControlCreator(ISourceViewer sourceViewer) getInformationPresenter(ISourceViewer sourceViewer) protected RuleBasedScannerReturns the JavaDoc scanner for this configuration.protected RuleBasedScannerReturns the Java multi-line comment scanner for this configuration.getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) Returns the outline presenter which will determine and shown information requested for the current cursor position.getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) protected IPreferenceStoreDeprecated.As of 3.0getPresentationReconciler(ISourceViewer sourceViewer) getQuickAssistAssistant(ISourceViewer sourceViewer) getReconciler(ISourceViewer sourceViewer) protected RuleBasedScannerReturns the Java single-line comment scanner for this configuration.protected RuleBasedScannerReturns the Java string scanner for this configuration.intgetTabWidth(ISourceViewer sourceViewer) getTextHover(ISourceViewer sourceViewer, String contentType) getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) voidAdapts 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, isShownInTextMethods 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_WIDTHPreference key used to look up display tab width.- Since:
- 2.0
- See Also:
-
SPACES_FOR_TABS
Deprecated.as of 3.1 useDefaultCodeFormatterConstants.FORMATTER_TAB_CHARPreference key for inserting spaces rather than tabs.- Since:
- 2.0
- See Also:
-
-
Constructor Details
-
JavaSourceViewerConfiguration
public JavaSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, 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, ornullif nonepartitioning- the document partitioning for this configuration, ornullfor the default partitioning- Since:
- 3.0
-
JavaSourceViewerConfiguration
public JavaSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, 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, ornullif nonepartitioning- the document partitioning for this configuration, ornullfor the default partitioningisModuleInfo-trueifJavaCodeScannershould be initialized for module-info code- Since:
- 3.14
-
JavaSourceViewerConfiguration
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, ornullif none- See Also:
-
-
Method Details
-
getCodeScanner
Returns the Java source code scanner for this configuration.- Returns:
- the Java source code scanner
-
getMultilineCommentScanner
Returns the Java multi-line comment scanner for this configuration.- Returns:
- the Java multi-line comment scanner
- Since:
- 2.0
-
getSinglelineCommentScanner
Returns the Java single-line comment scanner for this configuration.- Returns:
- the Java single-line comment scanner
- Since:
- 2.0
-
getStringScanner
Returns the Java string scanner for this configuration.- Returns:
- the Java string scanner
- Since:
- 2.0
-
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
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
- Overrides:
getPresentationReconcilerin classSourceViewerConfiguration
-
getContentAssistant
- Overrides:
getContentAssistantin classSourceViewerConfiguration
-
getQuickAssistAssistant
- Overrides:
getQuickAssistAssistantin classTextSourceViewerConfiguration
-
getReconciler
- Overrides:
getReconcilerin classTextSourceViewerConfiguration
-
getAutoEditStrategies
- Overrides:
getAutoEditStrategiesin classSourceViewerConfiguration
-
getDoubleClickStrategy
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) - Overrides:
getDoubleClickStrategyin classSourceViewerConfiguration
-
getDefaultPrefixes
- Overrides:
getDefaultPrefixesin classSourceViewerConfiguration
-
getIndentPrefixes
- Overrides:
getIndentPrefixesin classTextSourceViewerConfiguration
-
getTabWidth
- Overrides:
getTabWidthin classTextSourceViewerConfiguration
-
getAnnotationHover
- Overrides:
getAnnotationHoverin classTextSourceViewerConfiguration
-
getOverviewRulerAnnotationHover
- Overrides:
getOverviewRulerAnnotationHoverin classTextSourceViewerConfiguration
-
getConfiguredTextHoverStateMasks
- Overrides:
getConfiguredTextHoverStateMasksin classTextSourceViewerConfiguration
-
getTextHover
- Overrides:
getTextHoverin classSourceViewerConfiguration
-
getTextHover
- Overrides:
getTextHoverin classTextSourceViewerConfiguration
-
getConfiguredContentTypes
- Overrides:
getConfiguredContentTypesin classSourceViewerConfiguration
-
getConfiguredDocumentPartitioning
- Overrides:
getConfiguredDocumentPartitioningin classSourceViewerConfiguration
-
getContentFormatter
- Overrides:
getContentFormatterin classSourceViewerConfiguration
-
getInformationControlCreator
- Overrides:
getInformationControlCreatorin classSourceViewerConfiguration
-
getInformationPresenter
- Overrides:
getInformationPresenterin classSourceViewerConfiguration
-
getOutlinePresenter
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 IInformationPresenter getHierarchyPresenter(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
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
-
handlePropertyChangeEvent
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
- Overrides:
getHyperlinkDetectorTargetsin classTextSourceViewerConfiguration
-
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH