use of org.eclipse.jface.text.formatter.IFormattingStrategy in project dbeaver by serge-rider.
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;
}
Aggregations