Search in sources :

Example 1 with XMLFormattingStrategy

use of org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy 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

IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)1 MultiPassContentFormatter (org.eclipse.jface.text.formatter.MultiPassContentFormatter)1 XMLFormattingStrategy (org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy)1