com.aptana.ide.editors.unified
Class UnifiedConfiguration

java.lang.Object
  extended by org.eclipse.jface.text.source.SourceViewerConfiguration
      extended by com.aptana.ide.editors.unified.UnifiedConfiguration

public class UnifiedConfiguration
extends org.eclipse.jface.text.source.SourceViewerConfiguration

UnifiedConfiguration

Author:
Ingo Muschenetz

Field Summary
static java.lang.String CLASS_ATTR
          CLASS_ATTR
protected  org.eclipse.jface.preference.IPreferenceStore fPreferenceStore
          The preference store used to initialize this configuration.
static int HISTORY_BUFFER_SIZE
          Default history buffer size if not set in preferences
static java.lang.String NAME_ATTR
          NAME_ATTR
static java.lang.String UNIFIED_PARTITIONING
          UNIFIED_PARTITIONING
 
Constructor Summary
UnifiedConfiguration(UnifiedEditor editor, org.eclipse.jface.preference.IPreferenceStore preferenceStore)
          Creates a text source viewer configuration and initializes it with the given preference store.
 
Method Summary
 void dispose()
          dispose
 org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 UnifiedBracketInserterManager getBracketInserterManager(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String[] getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String getIndent()
          The current tab indent, expressed as spaces or a tab character
 java.lang.String[] getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
          this override sets the valid chars that can be at the start of an indent that will be tabbed to the right during a multiline tab indent
 org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
static org.eclipse.jface.text.IInformationControlCreator getInformationPresenterControlCreator()
          getInformationPresenterControlCreator
static java.lang.String getNewlineString()
          getNewlineString
 org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String[] getSpacesIndexPrefix()
          Returns the array of prefixes for use in indenting (where it is set to indent with spaces)
 UnifiedReconcilingStrategy getStrategy()
          Gets the strategy for this configuration
 java.lang.String getTabAsSpaces()
          The current tab indent, expressed as spaces
 java.lang.String[] getTabsIndexPrefix()
          Returns the array of prefixes for use in indenting (where it is set to indent with tabs)
 int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the tab width for the particular source viewer
 org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType, int stateMask)
           
 org.eclipse.jface.text.IUndoManager getUndoManager(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
static boolean isNewlineString(java.lang.String string)
          isNewlineString
 org.eclipse.jface.text.contentassist.IContentAssistant loadExtensionContentAssistant()
          Loads and registers the first content assistnant contributed via extension point
 void setTabWidth(int tabWidth, boolean useSpaces, org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Sets the current tab width, and whether to use tabs or space.
 boolean useSpacesAsTabs()
          Use spaces instead of tabs
 
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoIndentStrategy, getConfiguredTextHoverStateMasks, getContentFormatter, getHyperlinkPresenter, getHyperlinkStateMask, getIndentPrefixesForTab, getOverviewRulerAnnotationHover, getQuickAssistAssistant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_ATTR

public static final java.lang.String CLASS_ATTR
CLASS_ATTR

See Also:
Constant Field Values

NAME_ATTR

public static final java.lang.String NAME_ATTR
NAME_ATTR

See Also:
Constant Field Values

UNIFIED_PARTITIONING

public static final java.lang.String UNIFIED_PARTITIONING
UNIFIED_PARTITIONING

See Also:
Constant Field Values

HISTORY_BUFFER_SIZE

public static final int HISTORY_BUFFER_SIZE
Default history buffer size if not set in preferences

See Also:
Constant Field Values

fPreferenceStore

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

Note: protected since 3.1

Constructor Detail

UnifiedConfiguration

public UnifiedConfiguration(UnifiedEditor editor,
                            org.eclipse.jface.preference.IPreferenceStore preferenceStore)
Creates a text source viewer configuration and initializes it with the given preference store.

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

dispose

public void dispose()
dispose


getAutoEditStrategies

public org.eclipse.jface.text.IAutoEditStrategy[] getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                        java.lang.String contentType)
Overrides:
getAutoEditStrategies in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)

getConfiguredContentTypes

public java.lang.String[] getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getConfiguredContentTypes in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)

getConfiguredDocumentPartitioning

public java.lang.String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getConfiguredDocumentPartitioning in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer)

getContentAssistant

public org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getContentAssistant in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)

getBracketInserterManager

public UnifiedBracketInserterManager getBracketInserterManager(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
See Also:
SourceViewerConfiguration.getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)

getInformationControlCreator

public org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getInformationControlCreator in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer)

getInformationPresenterControlCreator

public static org.eclipse.jface.text.IInformationControlCreator getInformationPresenterControlCreator()
getInformationPresenterControlCreator

Returns:
IInformationControlCreator

getHyperlinkDetectors

public org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getHyperlinkDetectors in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)

getInformationPresenter

public org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getInformationPresenter in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer)

getDoubleClickStrategy

public org.eclipse.jface.text.ITextDoubleClickStrategy getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                              java.lang.String contentType)
Overrides:
getDoubleClickStrategy in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)

getPresentationReconciler

public org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getPresentationReconciler in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)

getTextHover

public org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                      java.lang.String contentType,
                                                      int stateMask)
Overrides:
getTextHover in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getTextHover(org.eclipse.jface.text.source.ISourceViewer, java.lang.String, int)

getTextHover

public org.eclipse.jface.text.ITextHover getTextHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                      java.lang.String contentType)
Overrides:
getTextHover in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getTextHover(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)

getAnnotationHover

public org.eclipse.jface.text.source.IAnnotationHover getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getAnnotationHover in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)

getReconciler

public org.eclipse.jface.text.reconciler.IReconciler getReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getReconciler in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getReconciler(org.eclipse.jface.text.source.ISourceViewer)

getNewlineString

public static java.lang.String getNewlineString()
getNewlineString

Returns:
String

isNewlineString

public static boolean isNewlineString(java.lang.String string)
isNewlineString

Parameters:
string -
Returns:
is the item a new line character?

getDefaultPrefixes

public java.lang.String[] getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                             java.lang.String contentType)
Overrides:
getDefaultPrefixes in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)

getIndentPrefixes

public java.lang.String[] getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                            java.lang.String contentType)
this override sets the valid chars that can be at the start of an indent that will be tabbed to the right during a multiline tab indent

Overrides:
getIndentPrefixes in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)

getSpacesIndexPrefix

public java.lang.String[] getSpacesIndexPrefix()
Returns the array of prefixes for use in indenting (where it is set to indent with spaces)

Returns:
String[]

getTabsIndexPrefix

public java.lang.String[] getTabsIndexPrefix()
Returns the array of prefixes for use in indenting (where it is set to indent with tabs)

Returns:
String[]

getTabWidth

public int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the tab width for the particular source viewer

Overrides:
getTabWidth in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - The source viewer
Returns:
The tab width

useSpacesAsTabs

public boolean useSpacesAsTabs()
Use spaces instead of tabs

Returns:
Use spaces instead of tabs

getTabAsSpaces

public java.lang.String getTabAsSpaces()
The current tab indent, expressed as spaces

Returns:
The string of spaces, equal to the current tab width;

getIndent

public java.lang.String getIndent()
The current tab indent, expressed as spaces or a tab character

Returns:
The current indent character;

setTabWidth

public void setTabWidth(int tabWidth,
                        boolean useSpaces,
                        org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Sets the current tab width, and whether to use tabs or space.

Parameters:
tabWidth - The number of "spaces" to use for a tab.
useSpaces - Insert spaces instead of tabs
sourceViewer - The current source viewer

getUndoManager

public org.eclipse.jface.text.IUndoManager getUndoManager(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getUndoManager in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getUndoManager(org.eclipse.jface.text.source.ISourceViewer)

getStrategy

public UnifiedReconcilingStrategy getStrategy()
Gets the strategy for this configuration

Returns:
- reconciling strategy

loadExtensionContentAssistant

public org.eclipse.jface.text.contentassist.IContentAssistant loadExtensionContentAssistant()
Loads and registers the first content assistnant contributed via extension point

Returns:
IContentAssistant