Search in sources :

Example 6 with ContentFormatter

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

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)

Example 7 with ContentFormatter

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

the class JSONSourceViewerConfiguration method getContentFormatter.

@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    ContentFormatter formatter = new ContentFormatter();
    formatter.setDocumentPartitioning(IDocument.DEFAULT_CONTENT_TYPE);
    IFormattingStrategy formattingStrategy = new JSONFormattingStrategy(sourceViewer, this);
    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)

Example 8 with ContentFormatter

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

the class JSONSourceViewerConfiguration method getContentFormatter.

@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    ContentFormatter formatter = new ContentFormatter();
    formatter.setDocumentPartitioning(IDocument.DEFAULT_CONTENT_TYPE);
    IFormattingStrategy formattingStrategy = new JSONFormattingStrategy(sourceViewer, this);
    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)

Example 9 with ContentFormatter

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

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 10 with ContentFormatter

use of org.eclipse.jface.text.formatter.ContentFormatter 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

ContentFormatter (org.eclipse.jface.text.formatter.ContentFormatter)10 IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)10 IFormattingStrategy (org.eclipse.jface.text.formatter.IFormattingStrategy)5 XMLFormattingStrategy (com.amalto.workbench.widgets.xmlviewer.format.XMLFormattingStrategy)1 SqlFormattingStrategy (com.cubrid.common.ui.query.format.SqlFormattingStrategy)1