use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project tdi-studio-se by Talend.
the class SQLSourceViewerConfiguration method getPresentationReconciler.
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr = new DefaultDamagerRepairer(getMultilineCommentScanner());
reconciler.setDamager(dr, IConstants.SQL_MULTILINE_COMMENT);
reconciler.setRepairer(dr, IConstants.SQL_MULTILINE_COMMENT);
dr = new DefaultDamagerRepairer(getSinglelineCommentScanner());
reconciler.setDamager(dr, IConstants.SQL_SINGLE_LINE_COMMENT);
reconciler.setRepairer(dr, IConstants.SQL_SINGLE_LINE_COMMENT);
dr = new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, IConstants.SQL_STRING);
reconciler.setRepairer(dr, IConstants.SQL_STRING);
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project cubrid-manager by CUBRID.
the class SQLViewerConfiguration method getPresentationReconciler.
/**
* Gets the presentation reconciler. This will color the code.
*
* @param sourceViewer ISourceViewer
* @return reconciler IPresentationReconciler
*/
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
// Create the presentation reconciler
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// Create the damager/repairer for comment partitions
String[] types = SQLPartitionScanner.getAllTypes();
for (String type : types) {
if (IDocument.DEFAULT_CONTENT_TYPE.equals(type)) {
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SQLKeyWordScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
} else {
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new StringCommentScanner());
reconciler.setDamager(dr, type);
reconciler.setRepairer(dr, type);
}
}
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project tmdm-studio-se by Talend.
the class ElementFKInfoConfiguration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
DefaultDamagerRepairer stringDR = new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(stringDR, ElementFKInfotPartitionScanner.COMMON_STRING);
reconciler.setRepairer(stringDR, ElementFKInfotPartitionScanner.COMMON_STRING);
DefaultDamagerRepairer keywordDR = new DefaultDamagerRepairer(getKeywordScanner());
reconciler.setDamager(keywordDR, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(keywordDR, IDocument.DEFAULT_CONTENT_TYPE);
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project tmdm-studio-se by Talend.
the class XMLConfiguration method getPresentationReconciler.
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getXMLTagScanner());
reconciler.setDamager(dr, IXMLPartitions.XML_TAG);
reconciler.setRepairer(dr, IXMLPartitions.XML_TAG);
reconciler.setDamager(dr, IXMLPartitions.XML_INCOMPLETETAG);
reconciler.setDamager(dr, IXMLPartitions.XML_ENDTAG);
reconciler.setRepairer(dr, IXMLPartitions.XML_ENDTAG);
reconciler.setDamager(dr, IXMLPartitions.XML_EMPTYTAG);
reconciler.setRepairer(dr, IXMLPartitions.XML_EMPTYTAG);
dr = new DefaultDamagerRepairer(getXMLScanner());
reconciler.setDamager(dr, IXMLPartitions.XML_TEXT);
reconciler.setRepairer(dr, IXMLPartitions.XML_TEXT);
NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(IXMLColorConstants.XML_COMMENT, null, 0));
reconciler.setDamager(ndr, IXMLPartitions.XML_COMMENT);
reconciler.setRepairer(ndr, IXMLPartitions.XML_COMMENT);
NonRuleBasedDamagerRepairer ndr2 = new NonRuleBasedDamagerRepairer(new TextAttribute(IXMLColorConstants.DECLARATION, null, 0));
reconciler.setDamager(ndr2, IXMLPartitions.XML_DECLARATION);
reconciler.setRepairer(ndr2, IXMLPartitions.XML_DECLARATION);
NonRuleBasedDamagerRepairer ndr3 = new NonRuleBasedDamagerRepairer(new TextAttribute(IXMLColorConstants.PROC_INSTR, null, 0));
reconciler.setDamager(ndr3, IXMLPartitions.XML_PI);
reconciler.setRepairer(ndr3, IXMLPartitions.XML_PI);
NonRuleBasedDamagerRepairer ndr4 = new NonRuleBasedDamagerRepairer(new TextAttribute(IXMLColorConstants.CDATA, null, 0));
reconciler.setDamager(ndr4, IXMLPartitions.XML_CDATA);
reconciler.setRepairer(ndr4, IXMLPartitions.XML_CDATA);
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project jbosstools-hibernate by jbosstools.
the class HQLSourceViewerConfiguration method getPresentationReconciler.
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
HQLColors colorProvider = new HQLColors();
PresentationReconciler reconciler = new PresentationReconciler();
String docPartitioning = getConfiguredDocumentPartitioning(sourceViewer);
reconciler.setDocumentPartitioning(docPartitioning);
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new HQLCodeScanner(colorProvider));
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(colorProvider.getColor(HQLPreferenceConstants.HQL_COMMENT_COLOR))));
reconciler.setDamager(dr, HQLPartitionScanner.HQL_COMMENT);
reconciler.setRepairer(dr, HQLPartitionScanner.HQL_COMMENT);
dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(colorProvider.getColor(HQLPreferenceConstants.HQL_QUOTED_LITERAL_COLOR))));
reconciler.setDamager(dr, HQLPartitionScanner.HQL_QUOTED_LITERAL);
reconciler.setRepairer(dr, HQLPartitionScanner.HQL_QUOTED_LITERAL);
return reconciler;
}
Aggregations