Search in sources :

Example 6 with TextAttribute

use of org.eclipse.jface.text.TextAttribute in project cubrid-manager by CUBRID.

the class XMLConfiguration method getXMLScanner.

/**
	 * Retrieves the XML Scanner.
	 * 
	 * @return scanner
	 */
protected XMLTitleScanner getXMLScanner() {
    if (scanner == null) {
        scanner = new XMLTitleScanner(colorManager);
        scanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.DEFAULT))));
    }
    return scanner;
}
Also used : XMLTitleScanner(com.cubrid.tool.editor.xml.scanner.XMLTitleScanner) TextAttribute(org.eclipse.jface.text.TextAttribute) Token(org.eclipse.jface.text.rules.Token)

Example 7 with TextAttribute

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;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler)

Example 8 with TextAttribute

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;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) Token(org.eclipse.jface.text.rules.Token)

Example 9 with TextAttribute

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;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) Token(org.eclipse.jface.text.rules.Token)

Example 10 with TextAttribute

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;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) NonRuleBasedDamagerRepairer(com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)

Aggregations

TextAttribute (org.eclipse.jface.text.TextAttribute)14 Token (org.eclipse.jface.text.rules.Token)6 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)3 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)3 RGB (org.eclipse.swt.graphics.RGB)3 NonRuleBasedDamagerRepairer (com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)2 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)2 XMLTagDamageRepairScanner (com.cubrid.tool.editor.xml.scanner.XMLTagDamageRepairScanner)1 XMLTitleScanner (com.cubrid.tool.editor.xml.scanner.XMLTitleScanner)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 AnchorWordDetector (org.dadacoalition.yedit.editor.scanner.AnchorWordDetector)1 DocumentStartAndEndRule (org.dadacoalition.yedit.editor.scanner.DocumentStartAndEndRule)1 DoubleQuotedKeyRule (org.dadacoalition.yedit.editor.scanner.DoubleQuotedKeyRule)1 IndicatorCharacterRule (org.dadacoalition.yedit.editor.scanner.IndicatorCharacterRule)1 KeyRule (org.dadacoalition.yedit.editor.scanner.KeyRule)1 PredefinedValueRule (org.dadacoalition.yedit.editor.scanner.PredefinedValueRule)1 ScalarRule (org.dadacoalition.yedit.editor.scanner.ScalarRule)1 SingleQuotedKeyRule (org.dadacoalition.yedit.editor.scanner.SingleQuotedKeyRule)1 TagWordDetector (org.dadacoalition.yedit.editor.scanner.TagWordDetector)1