Package org.eclipse.jface.text.rules

Examples of org.eclipse.jface.text.rules.IWordDetector


   
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("\'", "\'", string, '\\'));
    rules.add(new WhitespaceRule(new HTMLWhitespaceDetector()));
   
    WordRule delimitor = new WordRule(new IWordDetector(){
      public boolean isWordStart(char c){
        if(c=='<' || c=='%' || c=='@'){
          return true;
        }
        return false;
View Full Code Here


        // Add generic whitespace rule.
        list.add(new WhitespaceRule(new ApexCodeWhitespaceDetector()));

        if (Utils.isNotEmpty(docKeywords)) {
            // Add word rule for keywords.
            WordRule wordRule = new WordRule(new IWordDetector() {
                public boolean isWordStart(char c) {
                    return (c == '@');
                }

                public boolean isWordPart(char c) {
View Full Code Here

    static class WordPredicateRule extends WordRule implements IPredicateRule {

        private final IToken fSuccessToken;

        public WordPredicateRule(IToken successToken) {
            super(new IWordDetector() {
                public boolean isWordStart(char c) {
                    return (c == '/');
                }

                public boolean isWordPart(char c) {
View Full Code Here

        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;
                }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.rules.IWordDetector

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.