There is unfortunately no way out-of-the-box to do this. There are two approaches you can take:
- If all you literally need is to add keywords, but all other syntax is still Java syntax, you can try doing what I suggest in this post in another thread. For Java, you'd have to override a different addToken() method:
java code:
public void addToken(char[] array, int start, int end, int tokenType,
int startOffset, boolean hyperlink) {
if (tokenType==Token.IDENTIFIER) { // Assuming all of your new highlighted words are currently "identifiers"
int value = myWordsToHighlight.get(array, start, end);
if (value != -1) {
tokenType = value;
}
}
super.addToken(array, start,end, tokenType, startOffset, hyperlink);
}
- You can use TokenMakerMakr to create your own TokenMaker class for your language. You can easily recreate the basic syntax rules of a simpler language like Java, and define your own keywords. As discussed in that blog post though, you'll have to check this out from the trunk of SVN; there's no actual download for it currently.
Good luck!