Eclipse Platform
Release 3.1

org.eclipse.ui.editors.text
Class TextSourceViewerConfiguration

java.lang.Object
  extended byorg.eclipse.jface.text.source.SourceViewerConfiguration
      extended byorg.eclipse.ui.editors.text.TextSourceViewerConfiguration

public class TextSourceViewerConfiguration
extends SourceViewerConfiguration

Source viewer configuration for the text editor.

Since:
3.0

Field Summary
protected  IPreferenceStore fPreferenceStore
          The preference store used to initialize this configuration.
 
Constructor Summary
TextSourceViewerConfiguration()
          Creates a text source viewer configuration.
TextSourceViewerConfiguration(IPreferenceStore preferenceStore)
          Creates a text source viewer configuration and initializes it with the given preference store.
 
Method Summary
protected static int computeStateMask(String modifiers)
          Computes the state mask out of the given modifiers string.
protected static int findLocalizedModifier(String modifierName)
          Maps the localized modifier name to a code in the same manner as #findModifier.
 IAnnotationHover getAnnotationHover(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.
 IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer)
          Returns the hyperlink detectors which be used to detect hyperlinks in the given source viewer.
 IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer)
          Returns the hyperlink presenter for the given source viewer.
 int getHyperlinkStateMask(ISourceViewer sourceViewer)
          Returns the SWT event state mask which in combination with the left mouse button activates hyperlinking.
 int getTabWidth(ISourceViewer sourceViewer)
          Returns the visual width of the tab character.
 IUndoManager getUndoManager(ISourceViewer sourceViewer)
          Returns the undo manager for the given source viewer.
 
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoEditStrategies, getAutoIndentStrategy, getConfiguredContentTypes, getConfiguredDocumentPartitioning, getConfiguredTextHoverStateMasks, getContentAssistant, getContentFormatter, getDefaultPrefixes, getDoubleClickStrategy, getIndentPrefixes, getInformationControlCreator, getInformationPresenter, getOverviewRulerAnnotationHover, getPresentationReconciler, getReconciler, getTextHover, getTextHover
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fPreferenceStore

protected IPreferenceStore fPreferenceStore
The preference store used to initialize this configuration.

Note: protected since 3.1

Constructor Detail

TextSourceViewerConfiguration

public TextSourceViewerConfiguration()
Creates a text source viewer configuration.


TextSourceViewerConfiguration

public TextSourceViewerConfiguration(IPreferenceStore preferenceStore)
Creates a text source viewer configuration and initializes it with the given preference store.

Parameters:
preferenceStore - the preference store used to initialize this configuration
Method Detail

getAnnotationHover

public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
Description copied from class: 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 SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an annotation hover or null if no hover support should be installed

getTabWidth

public int getTabWidth(ISourceViewer sourceViewer)
Description copied from class: SourceViewerConfiguration
Returns the visual width of the tab character. This implementation always returns 4.

Overrides:
getTabWidth in class SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the tab width

getHyperlinkDetectors

public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer)
Description copied from class: 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 SourceViewerConfiguration
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

getHyperlinkStateMask

public int getHyperlinkStateMask(ISourceViewer sourceViewer)
Description copied from class: SourceViewerConfiguration
Returns the SWT event state mask which in combination with the left mouse button activates hyperlinking. This implementation always returns the SWT.MOD1.

Overrides:
getHyperlinkStateMask in class SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the SWT event state mask to activate hyperlink mode

getHyperlinkPresenter

public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer)
Description copied from class: SourceViewerConfiguration
Returns the hyperlink presenter for the given source viewer. This implementation always returns the DefaultHyperlinkPresenter.

Overrides:
getHyperlinkPresenter in class SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the hyperlink presenter or null if no hyperlink support should be installed

findLocalizedModifier

protected static final int findLocalizedModifier(String modifierName)
Maps the localized modifier name to a code in the same manner as #findModifier.

Parameters:
modifierName - the modifier name
Returns:
the SWT modifier bit, or 0 if no match was found
Since:
3.1

computeStateMask

protected static final int computeStateMask(String modifiers)
Computes the state mask out of the given modifiers string.

Parameters:
modifiers - a string containing modifiers
Returns:
the state mask
Since:
3.1

getUndoManager

public IUndoManager getUndoManager(ISourceViewer sourceViewer)
Description copied from class: SourceViewerConfiguration
Returns the undo manager for the given source viewer. This implementation always returns a new instance of DefaultUndoManager whose history length is set to 25.

Overrides:
getUndoManager in class SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an undo manager or null if no undo/redo should not be supported

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.