Archive for July, 2009

Focusable ToolTips

Thursday, July 30th, 2009

I like how Eclipse has special tooltips that can be focused when you hover over them or click on them.  I knew this could be implemented in Swing because of the work I’m doing for the AutoComplete library.  While you normally don’t need to focus a tooltip, it can be useful in certain cases.  Scrolling through Javadoc in the little autocomplete documentation window in Eclipse, for example.  Another handy use is in Eclipse spell checking functionality – the tooltip provides links to correct the word, ignore it, add it to the dictionary, etc.

So I decided to see just what it would take to implement them.  At a minimum I could use the same functionality for the new, WIP  SpellChecker add-on.  I’m tentatively calling them “FocusableTips.”  Here are some screens of what I’ve cobbled up so far.  First, the tooltip before focusing:

A FocusableTip before focusing

A FocusableTip before focusing

And, after clicking on it, the resizable, interactive tip:

A FocusableTip after clicking on it

A FocusableTip after clicking on it

Note the tip is now resizable, you can select and copy text, click on links, etc.  It seems on Windows and Linux you can actually click on the links before the tooltip is focused, but on OS X this doesn’t seem possible.  MouseEvent behavior seems different on that platform for unfocused windows.  I’ll have to explore this a little more.

RSTA SpellChecker Add-on

Wednesday, July 29th, 2009

Due to popular request, I’ve started working on a simple spell checker add-on for RSyntaxTextArea.  The work has been pretty straightforward so far, and there is already even a project in SVN for it.  The add-on will be a small jar you put on your classpath, and with a couple of calls you can hook it into any RSyntaxTextArea instance.

It’ll spell-check comments in source code, or the entire file if you are editing plain text.  Spelling errors are squiggle-underlined with the color of your choice, and tooltips are available offering any spelling suggestions.  Here’s a teaser screenshot:

SpellChecker Add-on Preview

The actual spell checking functionality is handled by Jazzy, an open-source spell checking engine for Java.  Luckily Jazzy is LGPL just like RSyntaxTextArea, and so that’s also the license this add-on will be released under.

If you download the preview from SVN, please keep in mind that it should be considered an alpha release.  I already have some more changes I’ve yet to push, and the API may change slightly before being officially released.  But feel free to play with it and offer suggestions!  It probably doesn’t work with the 1.3.4 release of RSTA, it probably requires the latest in the trunk for that project as well.

RSyntaxTextArea 1.3.4 Released!

Thursday, July 16th, 2009

RSyntaxTextArea 1.3.4 was just released on SourceForge!  Go get it!

This release adds Lisp syntax highlighting, fixes some issues with Mark Occurrences highlighting behavior, and other minor changes.