Missing class after migrating to 2.0.7

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Missing class after migrating to 2.0.7

Postby preditcon » Wed Jul 24, 2013 12:38 pm

Our .flex file contains a reference to org.fife.ui.rsyntaxtextarea.DefaultToken which is missing in newer versions of RSyntaxArea jars. When we upgrade to newer jars, we obviously get syntax errors as a result.

The only place with a reference to this class is in exception handling code of getTokenList(Segment text, int initialTokenType, int startOffset). I did not write this flex file, but it's obviously tailored towards RSytaxTextArea, perhaps even based on some template.

What happened to the mentioned class? I assume it has been deprecated in favor of something else?

java code:

catch (IOException ioe) {
return new DefaultToken();

While writing this, I browsed some source code and found out that org.fife.ui.rsyntaxtextarea.TokenImpl is what I'm looking for. Still posting for future reference. BTW, should I keep my eyes peeled for anything similar?

Yeah. That didn't work... TokenImpl is only present in svn repo, not within distro jars.

Code: Select all
Revision 769 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 16 05:02:29 2013 UTC (4 months, 1 week ago) by bobby_light
File length: 8196 byte(s)
Diff to previous 731

RSTA: Tokens no longer render themselves; painting is now handled by TokenPainter implementations.  Thus our silly "DefaultToken" and "VisibleWhitespaceToken" classes are replaced by just a "Token" class, and we have a "DefaultTokenPainter" and "VisibleWhitespaceTokenPainter" class instead.  This does mean that any user-created TokenMakers (e.g. by TMM or by hand) will not work without replacing references to "DefaultToken" with "Token".
Posts: 27
Joined: Wed Jan 25, 2012 10:09 am

Re: Missing class after migrating to 2.0.7

Postby robert » Fri Jul 26, 2013 2:55 am

In 2.0.7, "Token" is a concrete class, and is what your .flex file should use. Sorry for the API change.

And unfortunately, in the next release, it will change again. "Token" will become an interface, and "TokenImpl" will be the implementation you should use in scenarios like yours. That's why you're seeing TokenImpl in SVN, but the commit comment you found talks only about a concrete "Token" class.

I'll document this change better in the next release, as it will probably be "major" (bumping the required JVM version to 5.0 from 1.4). Again, I'm sorry about that!
User avatar
Posts: 852
Joined: Sat May 10, 2008 5:16 pm

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest