File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Syntax highlighting using WordRule

 
Chethan Sharma
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

Code:
=====
Color color = new Color(Display.getCurrent(), 0, 0, 0);
IToken plainCode =new Token(new TextAttribute(color));
WordRule keywordsRule = new WordRule(new IWordDetector(){


public boolean isWordStart(char c) {
return Character.isLetterOrDigit(c) || Character.isJavaIdentifierStart(c);
}
public boolean isWordPart(char c) {
return (c == '.') || Character.isLetterOrDigit(c) || Character.isJavaIdentifierPart(c);
}

},plainCode);

String keyword = "Test";
keywordsRule.addWord(keyword,plainCode );



I am not able to highlight "TEST","TEst","test".It highlights only"Test".
Pls let me know how to handle in all cases.

Thanks in Advance.
Rams
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Did you really intend for this to go in the Apache Tomcat forum?

If not, let me know where you want it to go and I'll move it there for you.
 
Chethan Sharma
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Ben Souther:
Did you really intend for this to go in the Apache Tomcat forum?

If not, let me know where you want it to go and I'll move it there for you.


I moved my query to swt section.Sorry for the incovience.

Thanks,
Rams
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic