- A Concurrent Affair - https://www.concurrentaffair.org -

Improved Javadoc and Auto-Completion Features for DrJava

A few days ago I committed some changes to DrJava, and honestly, I think they’re the best thing since sliced bread (and by “sliced bread”, I mean “Find All” or “Go to File” or perhaps the original “Open Java API Javadoc”).

The new features make the JUnit 3.8.2 Javadoc available for “Open Java API Javadoc” (Shift-F6), “Open Java API Javadoc for Word Under Cursor” (Ctrl-F6 or Apple-F6), and for auto-completion (Ctrl-Shift-Space or Apple-Shift-Space). The URL can be entered in the Javadoc preference
pane. Since the Javadoc for this version is not available at junit.org anymore, I have made them available at
http://www.cs.rice.edu/~javaplt/javadoc/junit3.8.2/ [1], and I use that as default URL. To speed things up and allow DrJava to use the class names for code completion even without internet connection, the index of the classes is included with the drjava.jar file.

There is also a list of URLs (“Additional Javadoc URLs”) where additional Javadoc URLs can be entered and which will also be parsed and used for “Open Java API Javadoc” and auto-completion. Unless these specify file:// URLs on the local hard drive, network access will be required to retrieve the index of the class files, but DrJava fails gracefully if it cannot acquire network access.

To try out this feature, you can add the URL http://drjava.org/javadoc/drjava [2] to the “Additional Javadoc URLs” in
the Javadoc preference pane, and then enter MainFr in the Definitions Pane. Press Ctrl-Shift-Space (or Apple-Shift-Space on Macs) to auto-complete the word, and DrJava will suggest MainFrame and MainFrameTest. Pick one of them and press Enter. DrJava will auto-complete the word. Now press Ctrl-F6 (or Apple-F6 on Macs) with the cursor on the word, and DrJava will open the corresponding Javadoc page.

The auto-completion and Javadoc features have bin in DrJava for nearly two years, by the way, but we have now added the ability to use user-specified Javadoc libraries.

[3] [4]Share [5]