org.eclipse.cdt.internal.ui.text
Class CSourceViewerConfiguration

java.lang.Object
  extended by org.eclipse.jface.text.source.SourceViewerConfiguration
      extended by org.eclipse.ui.editors.text.TextSourceViewerConfiguration
          extended by org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration
Direct Known Subclasses:
SimpleCSourceViewerConfiguration

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

Configuration for an SourceViewer which shows C/C++ code.


Constructor Summary
CSourceViewerConfiguration(IColorManager colorManager, org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.ui.texteditor.ITextEditor editor, java.lang.String partitioning)
          Creates a new C source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.
 
Method Summary
 void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
          Adapts the behavior of the contained components to the change encoded in the given event.
 boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)
           
 boolean affectsTextPresentation(org.eclipse.jface.util.PropertyChangeEvent event)
          Determines whether the preference change encoded by the given event changes the behavior of one of its contained components.
 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)
           
 java.lang.String[] getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 int[] getConfiguredTextHoverStateMasks(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(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.ui.texteditor.ITextEditor getEditor()
          Returns the editor in which the configured viewer(s) will reside.
 org.eclipse.jface.text.information.IInformationPresenter getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Creates outline presenter.
 org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 java.lang.String[] getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String contentType)
           
 org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer, boolean cutDown)
           
 org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 org.eclipse.jface.text.information.IInformationPresenter getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Creates outline presenter.
 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)
           
 int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 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)
           
 void handlePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent event)
          Adapts the behavior of the contained components to the change encoded in the given event.
 void resetScanners()
          Reset cached language dependent scanners.
 
Methods inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
getHyperlinkPresenter, getHyperlinkStateMask, getOverviewRulerAnnotationHover, getUndoManager
 
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoIndentStrategy, getQuickAssistAssistant
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSourceViewerConfiguration

public CSourceViewerConfiguration(IColorManager colorManager,
                                  org.eclipse.jface.preference.IPreferenceStore preferenceStore,
                                  org.eclipse.ui.texteditor.ITextEditor editor,
                                  java.lang.String partitioning)
Creates a new C source viewer configuration for viewers in the given editor using the given preference store, the color manager and the specified document partitioning.

Creates a C source viewer configuration in the new setup without text tools. Clients are allowed to call handlePropertyChangeEvent(PropertyChangeEvent) and disallowed to call getPreferenceStore() on the resulting C 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

getEditor

public org.eclipse.ui.texteditor.ITextEditor getEditor()
Returns the editor in which the configured viewer(s) will reside.

Returns:
the enclosing editor

getOutlinePresenter

public org.eclipse.jface.text.information.IInformationPresenter getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Creates outline presenter.

Returns:
Presenter with outline view.

getHierarchyPresenter

public org.eclipse.jface.text.information.IInformationPresenter getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Creates outline presenter.

Returns:
Presenter with outline view.

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)

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

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

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

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(ISourceViewer, String)

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(ISourceViewer, String)

getIndentPrefixes

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

getTabWidth

public int getTabWidth(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getTabWidth in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration

getAnnotationHover

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

getConfiguredTextHoverStateMasks

public int[] getConfiguredTextHoverStateMasks(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                              java.lang.String contentType)
Overrides:
getConfiguredTextHoverStateMasks in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration

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

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.ui.editors.text.TextSourceViewerConfiguration

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(ISourceViewer)

getContentFormatter

public org.eclipse.jface.text.formatter.IContentFormatter getContentFormatter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getContentFormatter in class org.eclipse.jface.text.source.SourceViewerConfiguration
See Also:
SourceViewerConfiguration.getContentFormatter(ISourceViewer)

affectsBehavior

public boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)

adaptToPreferenceChange

public void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
Adapts the behavior of the contained components to the change encoded in the given event.

Parameters:
event - the event to whch to adapt

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

getInformationControlCreator

public org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                                      boolean cutDown)

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

affectsTextPresentation

public boolean affectsTextPresentation(org.eclipse.jface.util.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(org.eclipse.jface.util.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:
CSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)

getHyperlinkDetectors

public org.eclipse.jface.text.hyperlink.IHyperlinkDetector[] getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getHyperlinkDetectors in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration

getConfiguredDocumentPartitioning

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

resetScanners

public void resetScanners()
Reset cached language dependent scanners.