Archive for January, 2009

Smarter Auto-Indentation

Sunday, January 25th, 2009

The next release of RSyntaxTextArea will feature smarter auto-indentation for languages that use curly braces to denote code blocks, such as C, Java and Perl.  Instead of just remembering the previous line’s indentation, now, lines in a new code block are indented, and typing the closing ‘}’ character of a code block out-dents that character.  This is a rather small feature but most editors these days offer it, and once you get it used to it, it’s hard to go back to an editor that doesn’t have it!

Check out revision 70 in Subversion if you want to check it out early.

RSyntaxTextArea 1.2.3 Released – Mark Occurrences Support Added

Thursday, January 22nd, 2009

RSyntaxTextArea 1.2.3 was just released on SourceForge. This is mostly a bugfix release, but it does have one interesting new feature – Mark Occurrences. After moving around, if the caret stays over an identifier or variable for a fixed length of time (around 1 second), all occurrences of that variable in the current source file will be marked. This lets you quickly get an idea of the usage of a variable or method in a class.

This handy feature has an API to enable or disable it to suit your tastes. See the setMarkOccurrences(boolean) and setMarkOccurrencesColor(Paint) methods in the Javadoc.

AutoCompletion site now up

Saturday, January 17th, 2009

AutoCompletion has enough features now where I’d really like other people to start trying out.  So I’ve added a little space for it on describing what it is and (soon) how to use it. There’s a nice WebStart example there of an editor for C with code completion for the C standard library.  The Javadoc is up as well. All that is needed now is a couple of examples to get people started.

I also can’t decide if AutoComplete warrants its own SourceForge project, or if it can just be a subproject of RSyntaxTextArea. While the library can be used on any JTextComponent, auto-completion is usually used in IDE’s and programmer’s editors, and AutoComplete does come with special hooks to work better with RSTA. On the other hand, being a separate project may allow it to be discovered and used by a larger audience. Decisions, decisions…

RSyntaxTextArea 1.2.2 Released

Friday, January 16th, 2009

RSyntaxTextArea 1.2.2 has been released at SourceForge. This is a minor release that fixes a few bugs that were reported from the field. Check it out!

Function Parameter Assistance

Monday, January 12th, 2009

Newly added to the AutoComplete library is parameter assistance… I’m not sure what you should actually call this feature, but it’s the one where typing a ( character causes a little tooltip to pop up describing the parameters for the function you’re entering:


Parameters are entered with default values. You can use tab and shift+tab to navigate through the parameters (ala Eclipse or NetBeans). The parameter you’re entering (separated by commas, for example) is highlighted in bold in the tooltip, and (if available), a short description of the currently active parameter is displayed.

This feature is configurable, just like the other autocomplete options, and can be turned off if you don’t have time to enter descriptive information about everything available to auto-complete.

I plan on making a very early release available on SourceForge this week. I’m interested in getting as much feedback as possible! As far as I know, RSTA and the AutoComplete library is the simplest way to get easy and powerful IDE-style features into Swing applications.

A minor update to RSyntaxTextArea will also be released, fixing a couple of minor bugs that have been reported by users.