use of org.eclipse.jface.text.TextAttribute in project cubrid-manager by CUBRID.
the class PropConfiguration method getPropertiesCommentScanner.
/**
* Retrieves the XML Tag Scanner.
*
* @return tagScanner
*/
protected PropPartitionScanner getPropertiesCommentScanner() {
if (commentScanner == null) {
commentScanner = new PropPartitionScanner();
commentScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IPropColorConstants.PROP_COMMENT))));
}
return commentScanner;
}
use of org.eclipse.jface.text.TextAttribute in project cubrid-manager by CUBRID.
the class PropConfiguration method getPresentationReconciler.
/**
* Retrieves the Presentation Reconciler
*
* @param sourceViewer ISourceViewer
* @return object of IPresentationReconciler
*/
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.PROP_COMMENT)));
reconciler.setDamager(ndr, PropPartitionScanner.PROPERTIES_COMMENT);
reconciler.setRepairer(ndr, PropPartitionScanner.PROPERTIES_COMMENT);
ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.DEFAULT)));
reconciler.setDamager(ndr, PropPartitionScanner.PROPERTIES_CONTENT);
reconciler.setRepairer(ndr, PropPartitionScanner.PROPERTIES_CONTENT);
ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.TAG)));
reconciler.setDamager(ndr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(ndr, IDocument.DEFAULT_CONTENT_TYPE);
return reconciler;
}
use of org.eclipse.jface.text.TextAttribute in project cubrid-manager by CUBRID.
the class XMLConfiguration method getXMLTagScanner.
/**
* Retrieves the XML Tag Scanner.
*
* @return tagScanner
*/
protected RuleBasedScanner getXMLTagScanner() {
if (tagScanner == null) {
tagScanner = new XMLTagDamageRepairScanner(colorManager);
tagScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.ATTR))));
}
return tagScanner;
}
use of org.eclipse.jface.text.TextAttribute in project cubrid-manager by CUBRID.
the class XMLConfiguration method getPresentationReconciler.
/**
* Retrieves the Presentation Reconciler
*
* @param sourceViewer ISourceViewer
* @return object of IPresentationReconciler
*/
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 KaiZen-OpenAPI-Editor by RepreZen.
the class JsonScanner method tokenAttribute.
private TextAttribute tokenAttribute(String colorPrefs, String boldPrefs, String italicPrefs, String underlinePrefs) {
int style = SWT.NORMAL;
boolean isBold = store.getBoolean(boldPrefs);
if (isBold) {
style = style | SWT.BOLD;
}
boolean isItalic = store.getBoolean(italicPrefs);
if (isItalic) {
style = style | SWT.ITALIC;
}
boolean isUnderline = store.getBoolean(underlinePrefs);
if (isUnderline) {
style = style | TextAttribute.UNDERLINE;
}
RGB color = PreferenceConverter.getColor(store, colorPrefs);
TextAttribute attr = new TextAttribute(colorManager.getColor(color), null, style);
return attr;
}
Aggregations