Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Rule not working.
Rule not working. [message #710637] Fri, 05 August 2011 08:44 Go to next message
Alex  is currently offline Alex
Messages: 2
Registered: August 2011
Junior Member
Hi, everyone!

I have question about Editor plugin. I created my rule such as WordRule.

I have this code in evaluatein method:

 public IToken evaluate(ICharacterScanner scanner) {
        int c = 0;

        if (scanner.getColumn() > 0) {
          c =;
          if (!Character.isWhitespace((char) c)) {
            return fDefaultToken;

        if (c != ICharacterScanner.EOF && fDetector.isWordStart((char) c)) {
            if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) {

                do {
                    if (!fDetector.isWordPart((char) c))

                        fBuffer.append((char) c);

                } while (c != ICharacterScanner.EOF);

                String buffer= fBuffer.toString().toLowerCase().trim();

                IToken token= (IToken)fWords.get(buffer);

                if (token != null) {
                    return token;

                if (fDefaultToken.isUndefined())
                return fDefaultToken;

1. When I started existing file, all working correct.
2. When I add whitespace between letter in word or before (after), all working correct.
3. When I add new letter before (after) to keyword part of old text has color such as predefined and new part of word has color such as undefined text. I debug my code and I see that this method return Token.Undefined.

What Do I do incorrect. Thanks for help!

Re: Rule not working. [message #710769 is a reply to message #710637] Fri, 05 August 2011 11:48 Go to previous message
Alex  is currently offline Alex
Messages: 2
Registered: August 2011
Junior Member
I've resolved this problem. I need just check a start character of my sequence like as start character of word.
Previous Topic:html5 tags in .php do not validate without a doctype
Next Topic:Zend Debugger Cannot connect
Goto Forum:

Current Time: Sat Oct 25 02:50:07 GMT 2014

Powered by FUDForum. Page generated in 0.28990 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software