use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project xtext-xtend by eclipse.
the class XtendSourceViewerConfiguration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
XtextPresentationReconciler reconciler = (XtextPresentationReconciler) super.getPresentationReconciler(sourceViewer);
IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
IColorManager colorManager = JavaPlugin.getDefault().getJavaTextTools().getColorManager();
JavaDocScanner javaDocScanner = new JavaDocScanner(colorManager, store, null);
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(javaDocScanner);
reconciler.setRepairer(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
reconciler.setDamager(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project hale by halestudio.
the class SimpleGroovySourceViewerConfiguration method getPresentationReconciler.
/*
* @see SourceViewerConfiguration#getPresentationReconciler(ISourceViewer)
*/
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr = new DefaultDamagerRepairer(getJavaDocScanner());
reconciler.setDamager(dr, IJavaPartitions.JAVA_DOC);
reconciler.setRepairer(dr, IJavaPartitions.JAVA_DOC);
dr = new DefaultDamagerRepairer(getMultilineCommentScanner());
reconciler.setDamager(dr, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
reconciler.setRepairer(dr, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
dr = new DefaultDamagerRepairer(getSinglelineCommentScanner());
reconciler.setDamager(dr, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
reconciler.setRepairer(dr, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
dr = new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, IJavaPartitions.JAVA_STRING);
reconciler.setRepairer(dr, IJavaPartitions.JAVA_STRING);
dr = new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, IJavaPartitions.JAVA_CHARACTER);
reconciler.setRepairer(dr, IJavaPartitions.JAVA_CHARACTER);
dr = new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, GroovyPartitionScanner.GROOVY_MULTILINE_STRINGS);
reconciler.setRepairer(dr, GroovyPartitionScanner.GROOVY_MULTILINE_STRINGS);
return reconciler;
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project dbeaver by dbeaver.
the class SQLEditorSourceViewerConfiguration method addContentTypeDamageRepairer.
private void addContentTypeDamageRepairer(PresentationReconciler reconciler, String contentType, String colorId) {
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(ruleManager.getColor(colorId))));
reconciler.setDamager(dr, contentType);
reconciler.setRepairer(dr, contentType);
}
use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project dbeaver by dbeaver.
the class XMLSourceViewerConfiguration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getXMLTagScanner());
reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG);
reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG);
dr = new DefaultDamagerRepairer(getXMLScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(COLOR_XML_COMMENT)));
reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);
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;
}
Aggregations