Search in sources :

Example 6 with IContentFormatter

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

the class StructuredTextViewerConfigurationCSS method getContentFormatter.

public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
        formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), ICSSPartitions.STYLE);
    ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS()));
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) MultiPassContentFormatter(org.eclipse.jface.text.formatter.MultiPassContentFormatter) FormatProcessorCSS(org.eclipse.wst.css.core.internal.format.FormatProcessorCSS) StructuredFormattingStrategy(org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)

Example 7 with IContentFormatter

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

the class TestViewerConfigurationJSP method testGetContentFormatter.

public void testGetContentFormatter() {
    // probably no display
    if (!fDisplayExists)
        return;
    IContentFormatter cf = fConfig.getContentFormatter(fViewer);
    assertNotNull("there is no content formatter", cf);
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter)

Example 8 with IContentFormatter

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

the class TestViewerConfigurationCSS method testGetContentFormatter.

public void testGetContentFormatter() {
    // probably no display
    if (!fDisplayExists)
        return;
    IContentFormatter cf = fConfig.getContentFormatter(fViewer);
    assertNotNull("there is no content formatter", cf);
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter)

Example 9 with IContentFormatter

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

the class StructuredTextViewerConfigurationJSON method getContentFormatter.

@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
        formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IJSONPartitions.JSON);
    ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorJSON()));
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) MultiPassContentFormatter(org.eclipse.jface.text.formatter.MultiPassContentFormatter) FormatProcessorJSON(org.eclipse.wst.json.core.format.FormatProcessorJSON) StructuredFormattingStrategy(org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)

Example 10 with IContentFormatter

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

the class TestViewerConfigurationHTML method testGetContentFormatter.

public void testGetContentFormatter() {
    // probably no display
    if (!fDisplayExists)
        return;
    IContentFormatter cf = fConfig.getContentFormatter(fViewer);
    assertNotNull("there is no content formatter", cf);
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter)

Aggregations

IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)20 ContentFormatter (org.eclipse.jface.text.formatter.ContentFormatter)9 IFormattingStrategy (org.eclipse.jface.text.formatter.IFormattingStrategy)5 MultiPassContentFormatter (org.eclipse.jface.text.formatter.MultiPassContentFormatter)5 StructuredFormattingStrategy (org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)3 XMLFormattingStrategy (com.amalto.workbench.widgets.xmlviewer.format.XMLFormattingStrategy)1 SqlFormattingStrategy (com.cubrid.common.ui.query.format.SqlFormattingStrategy)1 IDocument (org.eclipse.jface.text.IDocument)1 IDocumentExtension3 (org.eclipse.jface.text.IDocumentExtension3)1 IDocumentPartitioner (org.eclipse.jface.text.IDocumentPartitioner)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 StructuredTextPartitioner (org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner)1 XMLFormattingStrategy (org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy)1