Completion #2

A while ago I wrote about my project of creating a google gadget that gave easy access to javadoc documentation; my guinea pig is the java SDK 6 documentation. Here’s an update on how that’s going.

After my first attempt, which was modeled on google suggest, I’ve rewritten most of the UI stuff. Where the gadget used to pop up a list of suggestions it now has a stationary list:

I liked the original format but it turns out that it’s really hard for an iframe to create a popup that covers its surrounding frame. The good news is that the new format is much more robust and now, as far as I can tell, works reliably in firefox and safari. Also, it no longer loads the whole index of JDK6 classes when the gadget is first displayed but waits until you start to enter text into the text field.

Another improvement is that I’ve changed the format of the class index used by the gadget. The index is created by processing the HTML class index that’s part of the JavaDoc site and turning it into a javascript file with the same information in a compressed form that can be loaded directly by that gadget (note to self: potential security problem?). The HTML class index on the website is around 500K, my first shot at a compressed javascript index was 200K. In the latest version it’s only 60K and I’m sure I can get it down even further.

If you feel like trying it out you can add it to your customized google homepage:


Add to Google

It doesn’t work in internet explorer but I’m not sure if that is a bug or a feature. I’m leaning towards bug.

2 Responses to Completion #2

  1. Great!

    One bug: Pressing doesn’t pop up the Javadoc page, you have to click on the class name with the mouse. Having to use the mouse is evil.

    One feature request: In Eclipse’s Ctrl-Shift-T thingy you can just type the capital letters of the CamelCased class name. So typing NPE gets me the NullPointerException. This would be a great addition to the gadget.

  2. The thing is right at the top of my list, along with proper handling of inner classes (don’t look for Map.Entry).

    I’ve given the capital letters idea a lot of thought and I can’t seem to come up with a model where you don’t have to search (almost) the whole prefix tree to find all possible completions. Also, I would like to use not only capital letters but prefixes (so NPE, NPExc and NuPoEx all give you NullPointerException).

    If you have any ideas I’m all ears.

    By the way, I’ve made a lot of improvements but have stopped updating the location mentioned in the post. The new and improved version is under /api.

Leave a Reply

Your email address will not be published. Required fields are marked *


*