wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Syntax highlighting using WordRule Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

Syntax highlighting using WordRule

Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
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


chaithu
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
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
 
 
subject: Syntax highlighting using WordRule
 
Similar Threads
isLetterOrDigit
Syntax highlighting using WordRule
count of operands
count of operands
Old COBOL dude needs direction