use of org.eclipse.jface.text.presentation.IPresentationReconciler in project eclipse.platform.text by eclipse.
the class SourceViewerConfiguration method getPresentationReconciler.
/**
* Returns the presentation reconciler ready to be used with the given source viewer.
*
* @param sourceViewer the source viewer
* @return the presentation reconciler or <code>null</code> if presentation reconciling should not be supported
*/
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
return reconciler;
}
use of org.eclipse.jface.text.presentation.IPresentationReconciler in project ch.hsr.ifs.cdttesting by IFS-HSR.
the class Configuration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(final ISourceViewer sourceViewer) {
final PresentationReconciler reconciler = new PresentationReconciler();
DamagerRepairer ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.CDT_TEST_COMMENT), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_COMMENT);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_COMMENT);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.TEST_NAME), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_NAME);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_NAME);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.LANG_DEF), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_LANGUAGE);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_LANGUAGE);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.EXPECTED), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_EXPECTED);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_EXPECTED);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.CLASS_NAME), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_CLASS);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_CLASS);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.FILE_NAME), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_FILE);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_FILE);
ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.SELECTION), null, SWT.BOLD));
reconciler.setDamager(ndr, TestFile.PARTITION_TEST_SELECTION);
reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_SELECTION);
return reconciler;
}
use of org.eclipse.jface.text.presentation.IPresentationReconciler in project eclipse-integration-commons by spring-projects.
the class StsTextViewerConfiguration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
if (showHyperlinks) {
return super.getPresentationReconciler(sourceViewer);
}
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new RuleBasedScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
return reconciler;
}
use of org.eclipse.jface.text.presentation.IPresentationReconciler in project liferay-ide by liferay.
the class Configuration method getPresentationReconciler.
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
IToken defaultToken = null;
DefaultDamagerRepairer dr = null;
NonRuleBasedDamagerRepairer ndr = null;
defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_DIRECTIVE)));
ContentScanner contentScanner = new ContentScanner(defaultToken, colorManager);
for (int i = 0; i < PartitionScanner.DIRECTIVES.length; i++) {
dr = new DefaultDamagerRepairer(contentScanner);
reconciler.setDamager(dr, PartitionScanner.DIRECTIVES[i]);
reconciler.setRepairer(dr, PartitionScanner.DIRECTIVES[i]);
}
dr = new DefaultDamagerRepairer(contentScanner);
reconciler.setDamager(dr, PartitionScanner.FTL_DIRECTIVE);
reconciler.setRepairer(dr, PartitionScanner.FTL_DIRECTIVE);
dr = new DefaultDamagerRepairer(contentScanner);
reconciler.setDamager(dr, PartitionScanner.FTL_DIRECTIVE_END);
reconciler.setRepairer(dr, PartitionScanner.FTL_DIRECTIVE_END);
ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_XML_COMMENT)));
reconciler.setDamager(ndr, PartitionScanner.XML_COMMENT);
reconciler.setRepairer(ndr, PartitionScanner.XML_COMMENT);
ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_STRING)));
reconciler.setDamager(ndr, PartitionScanner.STRING);
reconciler.setRepairer(ndr, PartitionScanner.STRING);
ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_COMMENT)));
reconciler.setDamager(ndr, PartitionScanner.FTL_COMMENT);
reconciler.setRepairer(ndr, PartitionScanner.FTL_COMMENT);
defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_INTERPOLATION)));
dr = new DefaultDamagerRepairer(new ContentScanner(defaultToken, colorManager));
reconciler.setDamager(dr, PartitionScanner.FTL_INTERPOLATION);
reconciler.setRepairer(dr, PartitionScanner.FTL_INTERPOLATION);
defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_XML_TAG)));
dr = new DefaultDamagerRepairer(new ContentScanner(defaultToken, colorManager));
reconciler.setDamager(dr, PartitionScanner.XML_TAG);
reconciler.setRepairer(dr, PartitionScanner.XML_TAG);
return reconciler;
}
use of org.eclipse.jface.text.presentation.IPresentationReconciler in project tdq-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;
}
Aggregations