Search in sources :

Example 11 with IContentFormatter

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

the class TestViewerConfiguration method testGetContentFormatter.

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

Example 12 with IContentFormatter

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

the class TestViewerConfigurationXML 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 13 with IContentFormatter

use of org.eclipse.jface.text.formatter.IContentFormatter in project dbeaver by serge-rider.

the class PlainTextViewerConfiguration method getContentFormatter.

@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    ContentFormatter formatter = new ContentFormatter();
    formatter.setDocumentPartitioning(IDocument.DEFAULT_CONTENT_TYPE);
    formatter.enablePartitionAwareFormatting(false);
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) ContentFormatter(org.eclipse.jface.text.formatter.ContentFormatter)

Example 14 with IContentFormatter

use of org.eclipse.jface.text.formatter.IContentFormatter in project cubrid-manager by CUBRID.

the class SQLViewerConfiguration method getContentFormatter.

/**
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentFormatter(org.eclipse.jface.text.source.ISourceViewer)
	 * @param sourceViewer the source viewer to be configured by this
	 *        configuration
	 * @return a content formatter or <code>null</code> if formatting should not
	 *         be supported
	 */
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    ContentFormatter formatter = new ContentFormatter();
    formatter.setFormattingStrategy(new SqlFormattingStrategy(databaseProvider), IDocument.DEFAULT_CONTENT_TYPE);
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) ContentFormatter(org.eclipse.jface.text.formatter.ContentFormatter) SqlFormattingStrategy(com.cubrid.common.ui.query.format.SqlFormattingStrategy)

Example 15 with IContentFormatter

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

the class XMLSourceViewerConfiguration method getContentFormatter.

@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    ContentFormatter formatter = new ContentFormatter();
    formatter.setDocumentPartitioning(IDocument.DEFAULT_CONTENT_TYPE);
    IFormattingStrategy formattingStrategy = new XMLFormattingStrategy();
    formatter.setFormattingStrategy(formattingStrategy, IDocument.DEFAULT_CONTENT_TYPE);
    formatter.enablePartitionAwareFormatting(false);
    return formatter;
}
Also used : IFormattingStrategy(org.eclipse.jface.text.formatter.IFormattingStrategy) IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) ContentFormatter(org.eclipse.jface.text.formatter.ContentFormatter)

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