use of org.eclipse.jface.text.TextAttribute in project xtext-eclipse by eclipse.
the class TextAttributeProvider method createTextAttribute.
protected TextAttribute createTextAttribute(String id, TextStyle defaultTextStyle) {
TextStyle textStyle = new TextStyle();
preferencesAccessor.populateTextStyle(id, textStyle, defaultTextStyle);
int style = textStyle.getStyle();
Font fontFromFontData = EditorUtils.fontFromFontData(textStyle.getFontData());
return new TextAttribute(EditorUtils.colorFromRGB(textStyle.getColor()), EditorUtils.colorFromRGB(textStyle.getBackgroundColor()), style, fontFromFontData);
}
use of org.eclipse.jface.text.TextAttribute in project erlide_eclipse by erlang.
the class ErlTokenScanner method getTextAttribute.
// private static final List<String> RESERVED = Arrays.asList(new String[] {
// "after", "begin", "case", "try", "cond", "catch", "andalso",
// "orelse", "end", "fun", "if", "let", "of", "query", "receive",
// "when", "bnot", "not", "div", "rem", "band", "and", "bor", "bxor",
// "bsl", "bsr", "or", "xor", "spec", });
protected TextAttribute getTextAttribute(final TokenHighlight th) {
final IPreferenceStore store = ErlideUIPlugin.getDefault().getPreferenceStore();
final HighlightStyle data = th.getStyle(store);
// load from prefsstore
return new TextAttribute(fColorManager.getColor(data.getColor()), null, data.getStyles());
}
use of org.eclipse.jface.text.TextAttribute in project erlide_eclipse by erlang.
the class ErlTokenScanner method fixTokenData.
private void fixTokenData(final Token token, final RGB color, final int style) {
final TextAttribute attr = (TextAttribute) token.getData();
final int newStyle = style == -1 ? attr.getStyle() : style;
final Color newColor = color == null ? attr.getForeground() : fColorManager.getColor(color);
token.setData(new TextAttribute(newColor, attr.getBackground(), newStyle));
}
use of org.eclipse.jface.text.TextAttribute in project dbeaver by serge-rider.
the class XMLConfiguration 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.TextAttribute in project dbeaver by serge-rider.
the class XMLConfiguration method getXMLTagScanner.
XMLTagScanner getXMLTagScanner() {
XMLTagScanner tagScanner = new XMLTagScanner(colorManager);
tagScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(COLOR_TAG))));
return tagScanner;
}
Aggregations