use of org.eclipse.jface.text.formatter.IContentFormatter 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.IContentFormatter 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.IContentFormatter 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.IContentFormatter in project webtools.sourceediting by eclipse.
the class StructuredTextViewerConfigurationHTML method getContentFormatter.
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
IContentFormatter formatter = super.getContentFormatter(sourceViewer);
// generic one
if (!(formatter instanceof MultiPassContentFormatter))
formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT);
((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
return formatter;
}
use of org.eclipse.jface.text.formatter.IContentFormatter in project webtools.sourceediting by eclipse.
the class StructuredTextViewerConfigurationJSP method getContentFormatter.
public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
IContentFormatter formatter = super.getContentFormatter(sourceViewer);
// generic one
if (!(formatter instanceof MultiPassContentFormatter))
formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
MultiPassContentFormatter multiFormatter = (MultiPassContentFormatter) formatter;
multiFormatter.setMasterStrategy(new StructuredFormattingStrategyJSP());
multiFormatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);
return formatter;
}
Aggregations