Monthly Archives: December 2006

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.

Completion

I’ve been playing around with something new: google gadgets. Well, I’ve mostly been playing around with javascript and HTML because the part about packaging it together to form a gadget is actually pretty simple.

It’s an interesting experience for someone like me who has used dynamic web pages for years without the first clue about how they were implemented. So far, the fruit of my labors is limited to a gadget that lets you search javadoc (I haven’t thought up a name for it yet):


Ok, the screenshot actually only shows the control that will eventually inhabit the gadget. It’s inspired by the completion mechanism used in google suggest. When you enter text into the text field a list of suggestions will pop up that lets you jump to an appropriate javadoc page.

The javadoc index used to produce the list of suggestions is currently a (large!) piece of javascript code generated from the javadoc HTML class index by a perl script. But I intend to implement a mechanism so that the script just fetches the class list directly from the javadoc page. That way you should be able to point the gadget to any javadoc site and it will provide site-specific completion.

This does make me wonder: does anyone actually use javadoc on the web anymore? I mostly use it within eclipse and maybe everybody’s moved om from the web-based interface?

I hope to work on this over Christmas and have a beta ready within a week or two.

Update: I’ve put the current (alpha) version of this online at quenta.org/javadoc. I’ve only tested it in firefox 2 and you’ll notice that there are still a few kinks to sort out but I think it gives a reasonable impression of how it will eventually work.

Update #2: I’ve fixed some bugs so now you can actually click on the items and go to the appropriate javadoc page. At least for most items. Also, it should now work in safari as well. Also, it can now be added as a gadget:


Add to Google