org.eclipse.xtext.ui.editor
Class XtextSourceViewerConfiguration

java.lang.Object
  extended by org.eclipse.jface.text.source.SourceViewerConfiguration
      extended by org.eclipse.ui.editors.text.TextSourceViewerConfiguration
          extended by org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration

public class XtextSourceViewerConfiguration
extends org.eclipse.ui.editors.text.TextSourceViewerConfiguration

Author:
Sebastian Zarnekow - Initial contribution and API

Field Summary
 
Fields inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
fPreferenceStore
 
Constructor Summary
XtextSourceViewerConfiguration()
           
 
Method Summary
 org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.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.
 org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
          Returns the auto edit strategies ready to be used with the given source viewer when manipulating text of the given content type.
 java.lang.String[] getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns all configured content types for the given source viewer.
 org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the content assistant ready to be used with the given source viewer.
 org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the content formatter ready to be used with the given source viewer.
 java.lang.String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
          Returns the default prefixes to be used by the line-prefix operation in the given source viewer for text of the given content type.
protected  java.lang.String getDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
          Returns the double-click strategy ready to be used in this viewer when double clicking onto text of the given content type.
 org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the hyperlink detectors which be used to detect hyperlinks in the given source viewer.
 org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the presentation reconciler ready to be used with the given source viewer.
 com.google.inject.Provider<XtextPresentationReconciler> getPresentationReconcilerProvider()
           
 org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the quick assist assistant ready to be used with the given source viewer.
 org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the reconciler ready to be used with the given source viewer.
 ISingleLineCommentHelper getSingleLineCommentHelper()
           
 org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.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.
 void setPresentationReconcilerProvider(com.google.inject.Provider<XtextPresentationReconciler> presentationReconcilerProvider)
           
 void setSingleLineCommentHelper(ISingleLineCommentHelper singleLineCommentHelper)
           
 
Methods inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
computeStateMask, findLocalizedModifier, getConfiguredTextHoverStateMasks, getHyperlinkDetectorTargets, getHyperlinkPresenter, getHyperlinkStateMask, getIndentPrefixes, getOverviewRulerAnnotationHover, getRegisteredHyperlinkDetectors, getTabWidth, getUndoManager, isShowInOverviewRuler, isShowInVerticalRuler, isShownInText
 
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoIndentStrategy, getConfiguredDocumentPartitioning, getIndentPrefixesForTab, getInformationControlCreator, getInformationPresenter, getTextHover
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtextSourceViewerConfiguration

public XtextSourceViewerConfiguration()
Method Detail

getAnnotationHover

public org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns 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 returns null.

Overrides:
getAnnotationHover in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an annotation hover or null if no hover support should be installed

getTextHover

public org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                      java.lang.String contentType)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
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. This implementation always returns null.

Overrides:
getTextHover in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
contentType - the content type
Returns:
a text hover or null if no hover support should be installed

getContentAssistant

public org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the content assistant ready to be used with the given source viewer. This implementation always returns null.

Overrides:
getContentAssistant in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a content assistant or null if content assist should not be supported

getReconciler

public org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Returns the reconciler ready to be used with the given source viewer.

This implementation currently returns a MonoReconciler which is responsible for spell checking. In the future a different reconciler taking over more responsibilities might be returned.

Overrides:
getReconciler in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a reconciler or null if reconciling should not be supported
See Also:
SourceViewerConfiguration.getReconciler(org.eclipse.jface.text.source.ISourceViewer)

getPresentationReconciler

public org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the presentation reconciler ready to be used with the given source viewer.

Overrides:
getPresentationReconciler in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer
Returns:
the presentation reconciler or null if presentation reconciling should not be supported

getConfiguredContentTypes

public java.lang.String[] getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns all configured content types for the given source viewer. This list tells the caller which content types must be configured for the given source viewer, i.e. for which content types the given source viewer's functionalities must be specified. This implementation always returns new String[] { IDocument.DEFAULT_CONTENT_TYPE }.

Overrides:
getConfiguredContentTypes in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the configured content types for the given viewer

getDocumentPartitioning

protected java.lang.String getDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)

getHyperlinkDetectors

public org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns 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:
getHyperlinkDetectors in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an array with hyperlink detectors or null if no hyperlink support should be installed

getQuickAssistAssistant

public org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the quick assist assistant ready to be used with the given source viewer. This implementation always returns null.

Overrides:
getQuickAssistAssistant in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a quick assist assistant or null if quick assist should not be supported

getContentFormatter

public org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the content formatter ready to be used with the given source viewer. This implementation always returns null.

Overrides:
getContentFormatter in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a content formatter or null if formatting should not be supported

getDefaultPrefixes

public java.lang.String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                             java.lang.String contentType)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the default prefixes to be used by the line-prefix operation in the given source viewer for text of the given content type. This implementation always returns null.

Overrides:
getDefaultPrefixes in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
contentType - the content type for which the prefix is applicable
Returns:
the default prefixes or null if the prefix operation should not be supported

setSingleLineCommentHelper

public void setSingleLineCommentHelper(ISingleLineCommentHelper singleLineCommentHelper)

getSingleLineCommentHelper

public ISingleLineCommentHelper getSingleLineCommentHelper()

setPresentationReconcilerProvider

public void setPresentationReconcilerProvider(com.google.inject.Provider<XtextPresentationReconciler> presentationReconcilerProvider)

getPresentationReconcilerProvider

public com.google.inject.Provider<XtextPresentationReconciler> getPresentationReconcilerProvider()

getAutoEditStrategies

public org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                        java.lang.String contentType)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the auto edit strategies ready to be used with the given source viewer when manipulating text of the given content type. For backward compatibility, this implementation always returns an array containing the result of SourceViewerConfiguration.getAutoIndentStrategy(ISourceViewer, String).

Overrides:
getAutoEditStrategies in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
contentType - the content type for which the strategies are applicable
Returns:
the auto edit strategies or null if automatic editing is not to be enabled

getDoubleClickStrategy

public org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                              java.lang.String contentType)
Description copied from class: org.eclipse.jface.text.source.SourceViewerConfiguration
Returns the double-click strategy ready to be used in this viewer when double clicking onto text of the given content type. This implementation always returns a new instance of DefaultTextDoubleClickStrategy.

Overrides:
getDoubleClickStrategy in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
contentType - the content type for which the strategy is applicable
Returns:
a double-click strategy or null if double clicking should not be supported