Archive for January, 2013

RText 2.0.6 Released

Saturday, January 26th, 2013

RText 2.0.6 was just released!  Here’s a rundown of the major changes:

Syntax highlighting and code folding for JSON.  Folks doing a lot of work with web applications will appreciate this.

JSON Support in RText

JSON Support in RText

Improvements to the UI when a Substance Look and Feel is installed.  All trees and lists now use Substance’s striping and rollover effects, and colors used in miscellaneous custom components were tweaked to better fit in with the current Substance skin.

Substance in AutoComplete Popups

Substance in AutoComplete Popups

Fixed a ClassCastException when adding a JRE in the Java options panel.  This was bug 3600567, and was accidentally introduced with the last refactoring of the Java language support.

Updated the Turkish and French localizations.  Thanks to Burak and Pat!

A major side effect of the improved Substance support is that compilation is now done in two phases.  RText has always only required Java 1.4, but Substance requires Java 6 or newer (we’re actually shipping with Insubstantial, which is an active fork of Substance, since the original author stopped working on it).  To get around this, all of the “core” RText classes are built with Java 1.4, and all of the classes requiring Substance are built with Java 6; these classes are only referenced from the application via reflection to avoid a hard dependency.  If Java 1.4 or Java 5 is detected, RText will never load anything Substance related.

When will RText drop support for 1.4?  Probably not for awhile, especially when I can easily use functionality in newer versions easily enough via reflection as I’m currently doing (and only then for Substance, opening a browser/system editors for files, and for the scripting API).  And performance improvements are received via simply running in a newer JVM, not from compiling with one.  Perhaps when Java 8 GA is released this September, it might be time to consider moving to Java 5.  :)

Anyway, the list of new features going into the next release is already growing!  More on that soon.

 

RSyntaxTextArea 2.0.6 Released

Wednesday, January 23rd, 2013

RSyntaxTextArea 2.0.6 was just released on SourceForge!  Included are new versions of AutoComplete, RSTALanguageSupport, and SpellChecker.

RSTA now provides syntax highlighting and code folding for JSON:

JSON Support

JSON highlighting and code folding in RSTA

Further, the AutoComplete and RSTALanguageSupport libraries now look good in Substance (in particular, Insubstantial).  Previously, these libraries used DefaultListCellRenderer for their completion choices.  Substance, being the barrel of fun that it is, forces libraries to extend its own DefaultSubstanceListCellRenderer, otherwise they aren’t rendered with Substance’s striping, gradients and rollover effects.  Now, RSTA and its cousins detect when Substance is the current Look and Feel, and render with a DefaultSubstanceListCellRenderer when necessary.  Easy peasy!

 

Substance in AutoComplete Popups

Substance in AutoComplete Popups

(Pardon the fact that I didn’t update the editor color scheme to be dark as well!).  This is done via reflection, so there is still no build dependency on Substance.  This of course assumes that the DefaultSubstanceListCellRenderer class name and package don’t change in future releases of Insubstantial, but I highly doubt that’ll happen, considering it’s a maintenance fork of the original Substance.  And if something goes horribly wrong, the library should fall back into its default rendering path anyway.

The outline trees (JavaOutlineTree, XmlOutlineTree, etc.) still use DefaultTreeCellRenderer, but applications can use the same technique here – wrap the standard renderers for these components with SubstanceDefaultTreeCellRenderer, call delegate.getTreeCellRendererComponent(), then set the Substance renderer’s icon and text based on the delegate’s values.  Come to think of it, I’m not sure why I didn’t have the libraries automatically delegate like I did with the completion choices lists… maybe next release.  One thing you do lose from this delegation is the rollover effect – the render “looks” the same, but the animated rollover effect depends on the actual renderer being a DefaultSubstance*Renderer.  Since we’re only *delegating* to one, we’ll look like it, but won’t get the rollover effect.