use of org.eclipse.jface.text.formatter.ContentFormatter in project dbeaver by dbeaver.
the class SQLEditorSourceViewerConfiguration method getContentFormatter.
/**
* Creates, configures, and returns the ContentFormatter to use.
*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentFormatter(ISourceViewer)
*/
@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
ContentFormatter formatter = new ContentFormatter();
formatter.setDocumentPartitioning(SQLPartitionScanner.SQL_PARTITIONING);
IFormattingStrategy formattingStrategy = new SQLFormattingStrategy(sourceViewer, this, editor.getSyntaxManager());
for (String ct : SQLPartitionScanner.SQL_CONTENT_TYPES) {
formatter.setFormattingStrategy(formattingStrategy, ct);
}
formatter.enablePartitionAwareFormatting(false);
return formatter;
}
use of org.eclipse.jface.text.formatter.ContentFormatter in project tmdm-studio-se by Talend.
the class XMLConfiguration method getContentFormatter.
@Override
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
ContentFormatter formatter = new ContentFormatter();
formatter.enablePartitionAwareFormatting(false);
formatter.setFormattingStrategy(new XMLFormattingStrategy(sourceViewer), IDocument.DEFAULT_CONTENT_TYPE);
return formatter;
}
use of org.eclipse.jface.text.formatter.ContentFormatter in project jbosstools-hibernate by jbosstools.
the class HQLSourceViewerConfiguration method getContentFormatter.
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
ContentFormatter formatter = new ContentFormatter();
formatter.setDocumentPartitioning(HQL_PARTITIONING);
IFormattingStrategy formattingStrategy = new HQLFormattingStrategy();
formatter.setFormattingStrategy(formattingStrategy, IDocument.DEFAULT_CONTENT_TYPE);
return formatter;
}
use of org.eclipse.jface.text.formatter.ContentFormatter 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;
}
use of org.eclipse.jface.text.formatter.ContentFormatter 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;
}
Aggregations