use of org.eclipse.jface.text.TextAttribute in project tmdm-studio-se by Talend.
the class XMLConfiguration method getXMLTagScanner.
protected XMLTagScanner getXMLTagScanner() {
if (tagScanner == null) {
tagScanner = new XMLTagScanner(colorManager);
tagScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.TAG))));
}
return tagScanner;
}
use of org.eclipse.jface.text.TextAttribute 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, 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(IXMLColorConstants.XML_COMMENT)));
reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);
return reconciler;
}
use of org.eclipse.jface.text.TextAttribute in project tmdm-studio-se by Talend.
the class ElementFKInfoColorProvider method getToken.
public IToken getToken(String prefKey) {
Token token = (Token) tokenTable.get(prefKey);
if (token == null) {
String colorName = store.getString(prefKey);
if (colorName == null || colorName.isEmpty()) {
if (prefKey.equals(ElementFKInfoConfiguration.PREF_COLOR_DEFAULT)) {
// $NON-NLS-1$
colorName = "0,128,0";
} else if (prefKey.equals(ElementFKInfoConfiguration.PREF_COLOR_STRING)) {
// $NON-NLS-1$
colorName = "0,0,255";
} else if (prefKey.equals(ElementFKInfoConfiguration.PREF_COLOR_KEYWORD)) {
// $NON-NLS-1$
colorName = "0,0,128";
}
}
RGB rgb = StringConverter.asRGB(colorName);
token = new Token(new TextAttribute(getColor(rgb)));
tokenTable.put(prefKey, token);
}
return token;
}
use of org.eclipse.jface.text.TextAttribute in project abstools by abstools.
the class Preferences method getToken.
public static IToken getToken(IPreferenceStore store, String postfix) {
Color color = new Color(Display.getCurrent(), PreferenceConverter.getColor(store, SYNTAXCOLOR_COLOR + postfix));
IToken token = new Token(new TextAttribute(color, null, computeAttributes(store, postfix)));
return token;
}
use of org.eclipse.jface.text.TextAttribute 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;
}
Aggregations