org.eclipse.wst.sse.ui
Class StructuredTextViewerConfiguration

java.lang.Object
  extended byTextSourceViewerConfiguration
      extended byorg.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
Direct Known Subclasses:
StructuredTextViewerConfigurationCSS, StructuredTextViewerConfigurationDTD, StructuredTextViewerConfigurationHTML, StructuredTextViewerConfigurationXML

public class StructuredTextViewerConfiguration
extends 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, Serialized Form

Constructor Summary
StructuredTextViewerConfiguration()
          Creates a structured text viewer configuration.
 
Method Summary
 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.
 java.lang.String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer)
          Returns the configured partitioning for the given source viewer.
 int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, java.lang.String contentType)
           
 IContentAssistant getContentAssistant(ISourceViewer sourceViewer)
          Returns the content assistant ready to be used with the given source viewer.
 IContentFormatter getContentFormatter(ISourceViewer sourceViewer)
          Returns the content formatter ready to be used with the given source viewer.
 IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer)
          Returns the hyperlink presenter for the given source viewer.
 IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer)
          Returns the information control creator.
 IInformationPresenter getInformationPresenter(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(ISourceViewer sourceViewer, java.lang.String partitionType)
          Returns the line style providers that will be used for syntax highlighting in the given source viewer.
 IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)
          StructuredTextViewer currently does not support presentation reconciler, so clients cannot override this method to provide their own presentation reconciler.
 IReconciler getReconciler(ISourceViewer sourceViewer)
          Returns the reconciler ready to be used with the given source viewer.
 ITextHover getTextHover(ISourceViewer sourceViewer, java.lang.String contentType, int stateMask)
           
 IUndoManager getUndoManager(ISourceViewer sourceViewer)
          Returns the undo manager for the given source viewer.
 
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 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.
Note: Clients cannot override this method because this method returns a specially configured Annotation Hover for the StructuredTextViewer.

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

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the configured partitioning
See Also:
#getConfiguredContentTypes(ISourceViewer)

getConfiguredTextHoverStateMasks

public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer,
                                              java.lang.String contentType)

getContentAssistant

public final IContentAssistant getContentAssistant(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 cannot override this method. Instead, clients wanting to add their own processors should override getContentAssistProcessors(ISourceViewer, String)

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a content assistant
See Also:
#getContentAssistProcessors(ISourceViewer, String)

getContentFormatter

public IContentFormatter getContentFormatter(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.

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 IHyperlinkPresenter getHyperlinkPresenter(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.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a hyperlink presenter specially configured for StructuredTextViewer

getInformationControlCreator

public final IInformationControlCreator getInformationControlCreator(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.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
the information control creator

getInformationPresenter

public final IInformationPresenter getInformationPresenter(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)

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(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 IPresentationReconciler getPresentationReconciler(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.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
always returns null
See Also:
getLineStyleProviders(ISourceViewer, String)

getReconciler

public final IReconciler getReconciler(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.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
a reconciler

getTextHover

public ITextHover getTextHover(ISourceViewer sourceViewer,
                               java.lang.String contentType,
                               int stateMask)

getUndoManager

public final IUndoManager getUndoManager(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.

Parameters:
sourceViewer - the source viewer to be configured by this configuration
Returns:
an undo manager specially configured for StructuredTextViewer