Search in sources :

Example 6 with MultiPassContentFormatter

use of org.eclipse.jface.text.formatter.MultiPassContentFormatter in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfigurationXML method getContentFormatter.

public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
        formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
    ((MultiPassContentFormatter) formatter).setMasterStrategy(new XMLFormattingStrategy());
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) XMLFormattingStrategy(org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy) MultiPassContentFormatter(org.eclipse.jface.text.formatter.MultiPassContentFormatter)

Aggregations

MultiPassContentFormatter (org.eclipse.jface.text.formatter.MultiPassContentFormatter)6 IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)5 StructuredFormattingStrategy (org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)3 JavaFormattingStrategy (org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy)1 JavaTextTools (org.eclipse.jdt.ui.text.JavaTextTools)1 Document (org.eclipse.jface.text.Document)1 DocumentRewriteSession (org.eclipse.jface.text.DocumentRewriteSession)1 IDocument (org.eclipse.jface.text.IDocument)1 IDocumentExtension4 (org.eclipse.jface.text.IDocumentExtension4)1 FormattingContext (org.eclipse.jface.text.formatter.FormattingContext)1 IFormattingContext (org.eclipse.jface.text.formatter.IFormattingContext)1 FormattingStrategyJSPJava (org.eclipse.jst.jsp.ui.internal.format.FormattingStrategyJSPJava)1 StructuredFormattingStrategyJSP (org.eclipse.jst.jsp.ui.internal.format.StructuredFormattingStrategyJSP)1 FormatProcessorCSS (org.eclipse.wst.css.core.internal.format.FormatProcessorCSS)1 HTMLFormatProcessorImpl (org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl)1 FormatProcessorJSON (org.eclipse.wst.json.core.format.FormatProcessorJSON)1 XMLFormattingStrategy (org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy)1