org.eclipse.wst.sse.ui
Class StructuredTextViewerConfiguration

java.lang.Object
  extended by org.eclipse.jface.text.source.SourceViewerConfiguration
      extended by org.eclipse.ui.editors.text.TextSourceViewerConfiguration
          extended by org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
Direct Known Subclasses:
StructuredTextViewerConfigurationCSS, StructuredTextViewerConfigurationDTD, StructuredTextViewerConfigurationHTML, StructuredTextViewerConfigurationXML

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

Configuration for the source viewer used by StructuredTextEditor.
Note: While ISourceViewer is passed in for each get configuration, clients should create a new viewer configuration instance for each instance of source viewer as some methods return the same instance of an object, regardless of the sourceviewer.

Clients should subclass and override just those methods which must be specific to their needs.

Since:
1.0
See Also:
StructuredTextEditor, StructuredTextViewer

Constructor Summary
StructuredTextViewerConfiguration()
          Creates a structured text viewer configuration.
 
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.
 java.lang.String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the configured partitioning for the given source viewer.
 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)
          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.
 org.eclipse.jface.text.hyperlink.IHyperlinkPresenter getHyperlinkPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the hyperlink presenter for the given source viewer.
 org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the information control creator.
 org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          Returns the information presenter ready to be used with the given source viewer.
 org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider[] getLineStyleProviders(org.eclipse.jface.text.source.ISourceViewer sourceViewer, java.lang.String partitionType)
          Returns the line style providers that will be used for syntax highlighting in the given source viewer.
 org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
          StructuredTextViewer currently does not support presentation reconciler, so clients cannot override this method to provide their own presentation reconciler.
 org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 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.
 org.eclipse.jface.viewers.ILabelProvider getStatusLineLabelProvider(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 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)
          Returns the undo manager for the given source viewer.
 
Methods inherited from class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
getHyperlinkDetectors, getHyperlinkStateMask, getIndentPrefixes, getOverviewRulerAnnotationHover, getTabWidth, getTextHover
 
Methods inherited from class org.eclipse.jface.text.source.SourceViewerConfiguration
getAutoEditStrategies, getAutoIndentStrategy, getConfiguredContentTypes, getDefaultPrefixes, getDoubleClickStrategy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructuredTextViewerConfiguration

public StructuredTextViewerConfiguration()
Creates a structured text viewer configuration.

Method Detail

getAnnotationHover

public final 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.
Note: Clients cannot override this method because this method returns a specially configured Annotation Hover for the StructuredTextViewer.

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 specially configured for StructuredTextViewer

getConfiguredDocumentPartitioning

public final java.lang.String getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the configured partitioning for the given source viewer. The partitioning is used when the querying content types from the source viewer's input document.
Note: Clients cannot override this method at this time.

Overrides:
getConfiguredDocumentPartitioning in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the configured partitioning
See Also:
SourceViewerConfiguration.getConfiguredContentTypes(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

getContentAssistant

public 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.
Note: The same instance of IContentAssistant is returned regardless of the source viewer passed in.

Clients should generally not override this method. Instead, clients wanting to add their own processors should override getContentAssistProcessors(ISourceViewer, String)

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
See Also:
getContentAssistProcessors(ISourceViewer, String)

getContentFormatter

public 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.

It is not recommended that clients override this method as it may become final in the future and replaced by an extensible framework.

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

getHyperlinkPresenter

public final org.eclipse.jface.text.hyperlink.IHyperlinkPresenter getHyperlinkPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the hyperlink presenter for the given source viewer.
Note: Clients cannot override this method because this method returns a specially configured hyperlink presenter for the StructuredTextViewer.

Overrides:
getHyperlinkPresenter in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a hyperlink presenter specially configured for StructuredTextViewer

getInformationControlCreator

public final org.eclipse.jface.text.IInformationControlCreator getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the information control creator. The creator is a factory creating information controls for the given source viewer.
Note: Clients cannot override this method at this time.

Overrides:
getInformationControlCreator in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the information control creator

getInformationPresenter

public final org.eclipse.jface.text.information.IInformationPresenter getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the information presenter ready to be used with the given source viewer.

Clients cannot override this method. Instead, clients wanting to add their own information providers should override getInformationProvider(ISourceViewer, String)

Overrides:
getInformationPresenter in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a content assistant
See Also:
getInformationProvider(ISourceViewer, String)

getLineStyleProviders

public org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider[] getLineStyleProviders(org.eclipse.jface.text.source.ISourceViewer sourceViewer,
                                                                                                   java.lang.String partitionType)
Returns the line style providers that will be used for syntax highlighting in the given source viewer.

Not fully API since return type LineStyleProvider is not API.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
partitionType - the partition type for which the lineStyleProviders are applicable
Returns:
LineStyleProvders or null if should not be supported

getPresentationReconciler

public final org.eclipse.jface.text.presentation.IPresentationReconciler getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
StructuredTextViewer currently does not support presentation reconciler, so clients cannot override this method to provide their own presentation reconciler.
See getLineStyleProviders(ISourceViewer, String) for alternative way to provide highlighting information.

Overrides:
getPresentationReconciler in class org.eclipse.jface.text.source.SourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
always returns null
See Also:
getLineStyleProviders(ISourceViewer, String)

getQuickAssistAssistant

public org.eclipse.jface.text.quickassist.IQuickAssistAssistant getQuickAssistAssistant(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Overrides:
getQuickAssistAssistant in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration

getReconciler

public final 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.
Note: The same instance of IReconciler is returned regardless of the source viewer passed in.

Clients cannot override this method. Instead, clients wanting to add their own reconciling strategy should use the org.eclipse.wst.sse.ui.extensions.sourcevalidation extension point.

Overrides:
getReconciler in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a reconciler

getStatusLineLabelProvider

public org.eclipse.jface.viewers.ILabelProvider getStatusLineLabelProvider(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Parameters:
treeViewer -
Returns:
a label provider providing the status line contents
Since:
2.0

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

getUndoManager

public final org.eclipse.jface.text.IUndoManager getUndoManager(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Returns the undo manager for the given source viewer.
Note: Clients cannot override this method because this method returns a specially configured undo manager for the StructuredTextViewer.

Overrides:
getUndoManager in class org.eclipse.ui.editors.text.TextSourceViewerConfiguration
Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an undo manager specially configured for StructuredTextViewer