Package info.cukes.editor.rule

Examples of info.cukes.editor.rule.HighlightFullLineRule


        IToken comment = new Token(
            new TextAttribute(manager.getColor(CucumberColorConstants.COMMENT), null, SWT.ITALIC));

        IRule[] rules = new IRule[6];

        rules[0] = new HighlightFullLineRule("#", null, comment);
       
        IWordDetector keywordDetector = new IWordDetector() {
            @Override
            public boolean isWordStart(char c) {
                if (c == 'G' || c == 'A' || c == 'W' || c == 'T' || c == 'B') {
                    return true;
                }

                return false;
            }

            @Override
            public boolean isWordPart(char c) {
                return Character.isLowerCase(c);
            }
        };

        WordRule wordRule = new WordRule(keywordDetector);
        wordRule.addWord("Given", keyword);
        wordRule.addWord("And", keyword);
        wordRule.addWord("When", keyword);
        wordRule.addWord("Then", keyword);
        wordRule.addWord("But", keyword);
        rules[1] = wordRule;

        IWordDetector tableDetector = new IWordDetector() {
            @Override
            public boolean isWordStart(char c) {
                if (c == '|') {
                    return true;
                }

                return false;
            }

            @Override
            public boolean isWordPart(char c) {
                return false;
            }
        };

        WordRule tableRule = new WordRule(tableDetector);
        tableRule.addWord("|", tablePipe);
        rules[2] = tableRule;

        rules[3] = new HighlightFullLineRule("Scenario:", null, scenario);
        rules[4] = new HighlightFullLineRule("Scenario Outline:", null, scenario);
        rules[5] = new HighlightFullLineRule("Examples:", null, scenario);

        setRules(rules);
    }
View Full Code Here


        IToken comment = new Token(
            new TextAttribute(manager.getColor(CucumberColorConstants.COMMENT), null, SWT.ITALIC));

        IRule[] rules = new IRule[1];

        rules[0] = new HighlightFullLineRule("#", null, comment);

        setRules(rules);
    }
View Full Code Here

        IToken comment = new Token(
            new TextAttribute(manager.getColor(CucumberColorConstants.COMMENT), null, SWT.ITALIC));
       
        IRule[] rules = new IRule[3];

        rules[0] = new HighlightFullLineRule("#", null, comment);
        rules[1] = new HighlightFullLineRule("@", null, tag);
        rules[2] = new HighlightFullLineRule("Feature:", null, feature);
       
        setRules(rules);
    }
View Full Code Here

        IToken tag = new Token(
            new TextAttribute(manager.getColor(CucumberColorConstants.TAG), null, SWT.NORMAL));

        IRule[] rules = new IRule[1];

        rules[0] = new HighlightFullLineRule("@", null, tag);

        setRules(rules);
    }
View Full Code Here

        IToken scenarioToken = new Token(SCENARIO);
        IToken commentToken = new Token(COMMENT);
        IToken tagToken = new Token(TAG);

        IPredicateRule[] rules = new IPredicateRule[4];
        rules[0] = new HighlightFullLineRule("@", null, tagToken);
        rules[1] = new HighlightFullLineRule("#", null, commentToken);
        rules[2] = new ScenarioPartitionRule(scenarioToken);
        rules[3] = new FeaturePartitionRule(featureToken);

        setPredicateRules(rules);
    }
View Full Code Here

TOP

Related Classes of info.cukes.editor.rule.HighlightFullLineRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.