org.eclipse.wst.jsdt.ui.text

## Class JavaScriptSourceViewerConfiguration

- java.lang.Object
- - TextSourceViewerConfiguration
  - - org.eclipse.wst.jsdt.ui.text.JavaScriptSourceViewerConfiguration

    public class JavaScriptSourceViewerConfiguration
    extends TextSourceViewerConfiguration

Configuration for a source viewer which shows JavaScript code.

This class may be instantiated; it is not intended to be subclassed.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Constructor Summary

Constructors
Constructor and Description
`JavaScriptSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, java.lang.String partitioning)` Creates a new JavaScript source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `affectsTextPresentation(PropertyChangeEvent event)` Determines whether the preference change encoded by the given event changes the behavior of one of its contained components.
`IAnnotationHover` `getAnnotationHover(ISourceViewer sourceViewer)`
`IAutoEditStrategy[]` `getAutoEditStrategies(ISourceViewer sourceViewer, java.lang.String contentType)`
`protected RuleBasedScanner` `getCodeScanner()` Returns the JavaScript source code scanner for this configuration.
`protected IColorManager` `getColorManager()` Returns the color manager for this configuration.
`java.lang.String[]` `getConfiguredContentTypes(ISourceViewer sourceViewer)`
`java.lang.String` `getConfiguredDocumentPartitioning(ISourceViewer sourceViewer)`
`int[]` `getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, java.lang.String contentType)`
`IContentAssistant` `getContentAssistant(ISourceViewer sourceViewer)`
`IContentFormatter` `getContentFormatter(ISourceViewer sourceViewer)`
`java.lang.String[]` `getDefaultPrefixes(ISourceViewer sourceViewer, java.lang.String contentType)`
`ITextDoubleClickStrategy` `getDoubleClickStrategy(ISourceViewer sourceViewer, java.lang.String contentType)`
`protected ITextEditor` `getEditor()` Returns the editor in which the configured viewer(s) will reside.
`IInformationPresenter` `getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve)` Returns the hierarchy presenter which will determine and shown type hierarchy information requested for the current cursor position.
`protected java.util.Map<java.lang.String,IAdaptable>` `getHyperlinkDetectorTargets(ISourceViewer sourceViewer)`
`java.lang.String[]` `getIndentPrefixes(ISourceViewer sourceViewer, java.lang.String contentType)`
`IInformationControlCreator` `getInformationControlCreator(ISourceViewer sourceViewer)`
`IInformationPresenter` `getInformationPresenter(ISourceViewer sourceViewer)`
`protected RuleBasedScanner` `getJavaDocScanner()` Returns the JavaDoc scanner for this configuration.
`protected RuleBasedScanner` `getMultilineCommentScanner()` Returns the JavaScript multi-line comment scanner for this configuration.
`IInformationPresenter` `getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve)` Returns the outline presenter which will determine and shown information requested for the current cursor position.
`IAnnotationHover` `getOverviewRulerAnnotationHover(ISourceViewer sourceViewer)`
`IPresentationReconciler` `getPresentationReconciler(ISourceViewer sourceViewer)`
`IQuickAssistAssistant` `getQuickAssistAssistant(ISourceViewer sourceViewer)`
`IReconciler` `getReconciler(ISourceViewer sourceViewer)`
`protected RuleBasedScanner` `getSinglelineCommentScanner()` Returns the JavaScript single-line comment scanner for this configuration.
`protected RuleBasedScanner` `getStringScanner()` Returns the JavaScript string scanner for this configuration.
`int` `getTabWidth(ISourceViewer sourceViewer)`
`protected RuleBasedScanner` `getTemplateLiteralScanner()` Returns the JavaScript template literal scanner for this configuration.
`ITextHover` `getTextHover(ISourceViewer sourceViewer, java.lang.String contentType)`
`ITextHover` `getTextHover(ISourceViewer sourceViewer, java.lang.String contentType, int stateMask)`
`void` `handlePropertyChangeEvent(PropertyChangeEvent event)` Adapts the behavior of the contained components to the change encoded in the given event.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JavaScriptSourceViewerConfiguration

    public JavaScriptSourceViewerConfiguration(IColorManager colorManager,
                                               IPreferenceStore preferenceStore,
                                               ITextEditor editor,
                                               java.lang.String partitioning)

Creates a new JavaScript source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.

Creates a JavaScript source viewer configuration in the new setup without text tools. Clients are allowed to call `handlePropertyChangeEvent(PropertyChangeEvent)` on the resulting JavaScript 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 `null` if none
  `partitioning` - the document partitioning for this configuration, or `null` for the default partitioning

### Method Detail

#### getCodeScanner

    protected RuleBasedScanner getCodeScanner()

Returns the JavaScript source code scanner for this configuration.

Returns:
  the JavaScript source code scanner

#### getMultilineCommentScanner

    protected RuleBasedScanner getMultilineCommentScanner()

Returns the JavaScript multi-line comment scanner for this configuration.

Returns:
  the JavaScript multi-line comment scanner

#### getTemplateLiteralScanner

    protected RuleBasedScanner getTemplateLiteralScanner()

Returns the JavaScript template literal scanner for this configuration.

Returns:
  the JavaScript template literal scanner

#### getSinglelineCommentScanner

    protected RuleBasedScanner getSinglelineCommentScanner()

Returns the JavaScript single-line comment scanner for this configuration.

Returns:
  the JavaScript single-line comment scanner

#### getStringScanner

    protected RuleBasedScanner getStringScanner()

Returns the JavaScript string scanner for this configuration.

Returns:
  the JavaScript string scanner

#### getJavaDocScanner

    protected RuleBasedScanner getJavaDocScanner()

Returns the JavaDoc scanner for this configuration.

Returns:
  the JavaDoc scanner

#### getColorManager

    protected IColorManager getColorManager()

Returns the color manager for this configuration.

Returns:
  the color manager

#### getEditor

    protected ITextEditor getEditor()

Returns the editor in which the configured viewer(s) will reside.

Returns:
  the enclosing editor

#### getPresentationReconciler

    public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)

#### getContentAssistant

    public IContentAssistant getContentAssistant(ISourceViewer sourceViewer)

#### getQuickAssistAssistant

    public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer)

#### getReconciler

    public IReconciler getReconciler(ISourceViewer sourceViewer)

#### getAutoEditStrategies

    public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer,
                                                     java.lang.String contentType)

#### getDoubleClickStrategy

    public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer,
                                                           java.lang.String contentType)

#### getDefaultPrefixes

    public java.lang.String[] getDefaultPrefixes(ISourceViewer sourceViewer,
                                                 java.lang.String contentType)

#### getIndentPrefixes

    public java.lang.String[] getIndentPrefixes(ISourceViewer sourceViewer,
                                                java.lang.String contentType)

#### getTabWidth

    public int getTabWidth(ISourceViewer sourceViewer)

#### getAnnotationHover

    public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)

#### getOverviewRulerAnnotationHover

    public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer)

#### getConfiguredTextHoverStateMasks

    public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer,
                                                  java.lang.String contentType)

#### getTextHover

    public ITextHover getTextHover(ISourceViewer sourceViewer,
                                   java.lang.String contentType,
                                   int stateMask)

#### getTextHover

    public ITextHover getTextHover(ISourceViewer sourceViewer,
                                   java.lang.String contentType)

#### getConfiguredContentTypes

    public java.lang.String[] getConfiguredContentTypes(ISourceViewer sourceViewer)

#### getConfiguredDocumentPartitioning

    public java.lang.String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer)

#### getContentFormatter

    public IContentFormatter getContentFormatter(ISourceViewer sourceViewer)

#### getInformationControlCreator

    public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer)

#### getInformationPresenter

    public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer)

#### getOutlinePresenter

    public IInformationPresenter getOutlinePresenter(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 JavaScript element
Returns:
  an information presenter

#### 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 configuration
  `doCodeResolve` - a boolean which specifies whether code resolve should be used to compute the JavaScript element
Returns:
  an information presenter

#### affectsTextPresentation

    public boolean affectsTextPresentation(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

#### handlePropertyChangeEvent

    public void handlePropertyChangeEvent(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
See Also:
  `JavaScriptSourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)`

#### getHyperlinkDetectorTargets

    protected java.util.Map<java.lang.String,IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer)