Search in sources :

Example 16 with RuleBasedScanner

use of org.eclipse.jface.text.rules.RuleBasedScanner in project syncope by apache.

the class HTMLSourceConfiguration method getDirectiveScanner.

protected RuleBasedScanner getDirectiveScanner() {
    if (directiveScanner == null) {
        directiveScanner = new RuleBasedScanner();
        RGB rgb = IHTMLColorConstants.SCRIPT;
        Color color = new Color(Display.getCurrent(), rgb);
        directiveScanner.setDefaultReturnToken(new Token(new TextAttribute(color)));
    }
    return directiveScanner;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) Color(org.eclipse.swt.graphics.Color) Token(org.eclipse.jface.text.rules.Token) RGB(org.eclipse.swt.graphics.RGB) RuleBasedScanner(org.eclipse.jface.text.rules.RuleBasedScanner)

Example 17 with RuleBasedScanner

use of org.eclipse.jface.text.rules.RuleBasedScanner in project syncope by apache.

the class HTMLSourceConfiguration method getCommentScanner.

protected RuleBasedScanner getCommentScanner() {
    if (commentScanner == null) {
        commentScanner = new RuleBasedScanner();
        RGB rgb = IHTMLColorConstants.HTML_COMMENT;
        Color color = new Color(Display.getCurrent(), rgb);
        commentScanner.setDefaultReturnToken(new Token(new TextAttribute(color)));
    }
    return commentScanner;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) Color(org.eclipse.swt.graphics.Color) Token(org.eclipse.jface.text.rules.Token) RGB(org.eclipse.swt.graphics.RGB) RuleBasedScanner(org.eclipse.jface.text.rules.RuleBasedScanner)

Aggregations

RuleBasedScanner (org.eclipse.jface.text.rules.RuleBasedScanner)17 Token (org.eclipse.jface.text.rules.Token)13 TextAttribute (org.eclipse.jface.text.TextAttribute)9 Document (org.eclipse.jface.text.Document)8 IDocument (org.eclipse.jface.text.IDocument)8 IToken (org.eclipse.jface.text.rules.IToken)8 WordRule (org.eclipse.jface.text.rules.WordRule)8 PatternRule (org.eclipse.jface.text.rules.PatternRule)6 IRule (org.eclipse.jface.text.rules.IRule)4 IWordDetector (org.eclipse.jface.text.rules.IWordDetector)4 Color (org.eclipse.swt.graphics.Color)4 RGB (org.eclipse.swt.graphics.RGB)4 Test (org.junit.Test)4 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)3 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)3 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)3