The Source for Java Technology Collaboration
User: Password:



Ben Galbraith

Ben Galbraith's Blog

Give Me My Commodity Text Widget Features, Please

Posted by javaben on November 19, 2005 at 09:18 AM | Comments (6)

(Cross-posted on Married... with children)

One of OS X's pioneering features was giving check-as-you-type, right-click-suggest spell checking to every application that wanted it, free of charge. It's so nice to be able to focus on writing without worrying that I've made an obvious spelling error, or, even better, intentionally mispelling a word so I can get instant access to the right variation -- and being able to do this in almost any context.

Amazing that years later, something that useful and handy is absent from the Java Desktop stack* and Windows. In the meantime, Apple took it a step further with the latest release of OS X: a commodity dictionary.

The next text widget feature I want to see commoditized is auto-complete. I've been authoring some documents in XML and XHTML, and my text editor memorizes every word I've entered and offers autocomplete options (if I request them). It's addictive and productive. And I want it everywhere -- especially in my Swing applications.

* If the service isn't present natively (and on Windows/Linux I don't imagine it is), just provide a Java native version


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I'm not sure from your last paragraph if you know that auto-completion is standard on OS X or not....

    All (well, most) text fields in OS X support completion since 10.3. The default is to use the spelling dictionary and, for me, it's actioned with opt+esc (that might not be the standard key stroke, as I changed it a few times when I fist discovered it a year or so back, it might be F5).

    For other apps, like SubEthaEdit, it's extended to support whatever language you're currently editing.. ditto Xcode (Apple's free development IDE).

    For Java to support these things, whether the underlying OS supports it or not, is good and I'd welcome it.

    Posted by: goron on November 19, 2005 at 09:44 AM

  • goron: Err, wow. I had no idea. Unfortunately, it's a lame implementation -- it doesn't refine the auto-complete suggestions as you type, and the only way to select something is by using the mouse or the down-arrow key, but hey -- it's more than I knew they had! Awesome.

    But yeah, many programs add this feature on their own, that's true.

    Posted by: javaben on November 19, 2005 at 10:26 AM

  • I've been thinking of this ever since some guy posted a list of critiques of linux (slashdotted... don't remember the link, sorry). One of these was that every text component should have spell check out of the box. I didn't know OS X was doing this.

    Along with that, of course, needs to be some kind of dictionary support. Where possible, that should be native, as you noted.

    Autocomplete should be easy once you have a dictionary. In SwingX we have an autocomplete package (org.jdesktop.swingx.autocomplete) which is useable with any text component. Providing the dictionary is the only tough part (unless you have a combo box, of course, in which case it all wires up nicely).

    Richard

    Posted by: rbair on November 22, 2005 at 08:30 AM


  • There is a project in javaHispano called JMySpell that adds SpellChecking functionality to any Swing TextComponent. It uses the same dictionaries available to OpenOffice. I haven't tested it, since it requires java 1.5 and I'm using 1.4, but seems good.


    The web is jMySpell.

    Eduard

    Posted by: eduardj on November 22, 2005 at 09:28 AM

  • rbair: Hey Richard! There are a number of free (and comprehensive) spelling dictionaries out there; not sure about definition directionaries. Great to hear about autocomplete. I'll take a look at the SwingX code and see if I can whip something up. I've been meaning to contribute.

    eduardj: Cool, I'll take a look. Thanks for the tip.

    Posted by: javaben on November 22, 2005 at 10:43 PM

  • Hi Ben. Have a look at http://www.ansir.ca/autocomplete.jsp for a very customizable auto complete. There is a free download with examples. It's very flexible so wrap it any way you want as the layout is up to you. The autocomplete examples include a text field with a list, just a text field, and a popup text field. The product is very fast, and very small so there is no need to download a huge infrastructure for getting want you asked for.

    Posted by: dan_andrews on February 17, 2007 at 09:10 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds