Mylyn WikiText

org.eclipse.mylyn.wikitext.ui.editor
Class MarkupSourceViewerConfiguration

java.lang.Object
  extended by TextSourceViewerConfiguration
      extended by org.eclipse.mylyn.wikitext.ui.viewer.AbstractTextSourceViewerConfiguration
          extended by org.eclipse.mylyn.wikitext.ui.editor.MarkupSourceViewerConfiguration
Direct Known Subclasses:
MarkupTaskEditorExtension.TaskMarkupSourceViewerConfiguration

public class MarkupSourceViewerConfiguration
extends AbstractTextSourceViewerConfiguration

A source viewer configuration suitable for installing on a markup editor

Since:
1.1
Author:
David Green

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.mylyn.wikitext.ui.viewer.AbstractTextSourceViewerConfiguration
AbstractTextSourceViewerConfiguration.HyperlinkDetectorDescriptorFilter
 
Field Summary
 
Fields inherited from class org.eclipse.mylyn.wikitext.ui.viewer.AbstractTextSourceViewerConfiguration
markupHyperlinksFirst
 
Constructor Summary
MarkupSourceViewerConfiguration(IPreferenceStore preferenceStore)
           
 
Method Summary
protected  IContentAssistProcessor[] createContentAssistProcessors()
          subclasses may override this method to create additional content assist processors.
 String[] getConfiguredContentTypes(ISourceViewer sourceViewer)
           
 IContentAssistant getContentAssistant(ISourceViewer sourceViewer)
           
 Font getDefaultFont()
          the default font, as used by the scanner.
 Font getDefaultMonospaceFont()
          the default font for monospace text, as used by the scanner.
 ITokenScanner getMarkupScanner()
           
protected  IInformationControlCreator getOutlineInformationControlCreator()
           
 IInformationPresenter getOutlineInformationPresenter(ISourceViewer sourceViewer)
          provide access to an information presenter that can be used to pop-up a quick outline.
 IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)
           
 IReconciler getReconciler(ISourceViewer sourceViewer)
           
 IShowInTarget getShowInTarget()
          provide a show in target to connect the quick-outline popup with the editor.
 ITextHover getTextHover(ISourceViewer sourceViewer, String contentType)
           
 void setDefaultFont(Font defaultFont)
          the default font, as used by the scanner.
 void setDefaultMonospaceFont(Font defaultMonospaceFont)
          the default font for monospace text, as used by the scanner.
 void setFile(IFile file)
          Set the file being edited.
 void setMarkupLanguage(MarkupLanguage markupLanguage)
          Set the markup language of the configuration.
 void setOutline(OutlineItem outlineModel)
          Set the outline on this configuration.
 void setShowInTarget(IShowInTarget showInTarget)
          provide a show in target to connect the quick-outline popup with the editor.
 
Methods inherited from class org.eclipse.mylyn.wikitext.ui.viewer.AbstractTextSourceViewerConfiguration
addHyperlinkDetector, addHyperlinkDetectorDescriptorFilter, createCustomHyperlinkDetectors, getHyperlinkDetectors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupSourceViewerConfiguration

public MarkupSourceViewerConfiguration(IPreferenceStore preferenceStore)
Method Detail

getMarkupScanner

public ITokenScanner getMarkupScanner()
Since:
1.1

getPresentationReconciler

public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)

getContentAssistant

public IContentAssistant getContentAssistant(ISourceViewer sourceViewer)

createContentAssistProcessors

protected IContentAssistProcessor[] createContentAssistProcessors()
subclasses may override this method to create additional content assist processors.

Returns:
processors, or null if there are none.

setMarkupLanguage

public void setMarkupLanguage(MarkupLanguage markupLanguage)
Set the markup language of the configuration. Causes the completion processor, validating reconciling strategy and other configuration elements to be aware of the markup language in use. This may be called more than once during the lifecycle of the editor.

Parameters:
markupLanguage - the markup language

getReconciler

public IReconciler getReconciler(ISourceViewer sourceViewer)

setFile

public void setFile(IFile file)
Set the file being edited. If a file is being edited this allows for validation to create markers on the file. Some editors are not file-based and thus need not invoke this method.

Parameters:
file - the file, which may be null.

getTextHover

public ITextHover getTextHover(ISourceViewer sourceViewer,
                               String contentType)

getOutlineInformationPresenter

public IInformationPresenter getOutlineInformationPresenter(ISourceViewer sourceViewer)
provide access to an information presenter that can be used to pop-up a quick outline. Source viewers should configure as follows:
 public void configure(SourceViewerConfiguration configuration) {
        super.configure(configuration);
        if (configuration instanceof MarkupSourceViewerConfiguration) {
                outlinePresenter = ((MarkupSourceViewerConfiguration) configuration).getOutlineInformationPresenter(this);
                outlinePresenter.install(this);
        }
 }
 

Parameters:
sourceViewer - the source viewer for which the presenter should be created
Returns:
the presenter

getConfiguredContentTypes

public String[] getConfiguredContentTypes(ISourceViewer sourceViewer)

getOutlineInformationControlCreator

protected IInformationControlCreator getOutlineInformationControlCreator()

setOutline

public void setOutline(OutlineItem outlineModel)
Set the outline on this configuration. Outlines are used for document-internal references as well as for quick outline. Editors that call this method must keep the outline up to date as the source document changes. Editors that do not maintain an outline need not call this method, since the outline will be computed as needed for the quick outline.

Parameters:
outlineModel -

getDefaultFont

public Font getDefaultFont()
the default font, as used by the scanner.


setDefaultFont

public void setDefaultFont(Font defaultFont)
the default font, as used by the scanner.


getDefaultMonospaceFont

public Font getDefaultMonospaceFont()
the default font for monospace text, as used by the scanner.


setDefaultMonospaceFont

public void setDefaultMonospaceFont(Font defaultMonospaceFont)
the default font for monospace text, as used by the scanner.


getShowInTarget

public IShowInTarget getShowInTarget()
provide a show in target to connect the quick-outline popup with the editor.


setShowInTarget

public void setShowInTarget(IShowInTarget showInTarget)
provide a show in target to connect the quick-outline popup with the editor.


Mylyn WikiText

Copyright © 2007, 2009 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html