Indexing Java SDK Docs with QuickSilver
Developer — 26 Sep 2006 19:48 — 1962 days ago

By now I am totally dependent on the ability to look up Cocoa or Java API reference documentation with QuickSilver (or LaunchBar before that). If you're a developer and you don't use something like this already, you should definitely check it out.

I can hit Cmd-Space to invoke QuickSilver, then type “nss” and after hitting Return I get immediate access to the NSString class documentation (when hacking Cocoa); or I can type “stri” and get the java.lang.String reference page. In the screenshot below, you can see that I typed “arrl” to look up “ArrayList”.

Both the Cocoa and Java API documentation comes as a collection of HTML files, one neatly named file per library class, like NSString.html or HashMap.html. This is an ideal format for indexing into QuickSilver’s catalog using the File/Folder catalog scanner plugin. Being used to QuickSilver’s powerful options everywhere else in the program, I was really disappointed to see how incredibly lame this File/Foler plugin is. I expected a rich set of options to specify precisely which files and folders to include and exclude, possibly even with regular expressions.

Unfortunately, there are no exclude options at all. This is a problem when trying to index Sun’s SDK Javadoc package: There are about 3500 HTML files for the standard Java classes in the package. Scattered throughout the directory hierarchy, there are “class-use” directories which contain another 3500 HTML files with the exact same class names, but this second set of files is not of interest and should be excluded. I was hoping to be able to set an exclude pattern for these “class-use” directories, something that’s possible in LaunchBar but not in QuickSilver.

The result of indexing the documentation package this way is that every single class comes up with two entries in QuickSilver’s result list, one is the desired documentation page, and the other one is the unwanted class-use page. It’s completely unusable in this form.

After ranting about the underwhelming scanner plugin, I’ll also present an easy workaround: Instead of using the File/Folder scanner, I added the “allclasses-frame.html” file into a new “J2SE-150” group in the catalog and set the “Include Contents” option to “HTML Links”. QuickSilver will parse the HTML file and since the file contains a long list of links to all the class pages, the result in the index is exactly what I want. As you can see in the screenshot, it picks up about 3200 classes.


Comments
Posted by Marc on 27 Sep 2006 11:51

The Cocoa documentation should be on the file system when you install Xcode, under /Developer/ADC Reference Library. If not, go to ADC Connect and download the “September 2006 ADC Reference Library Update”.

Likewise, the Java API documentation is available as an additional install from connect.apple.com, look for “ J2SE 5.0 Release 4 Developer Documentation” in the “Java” category.

Once you have the documentation installed, you need to get QuickSilver to index it. For the Cocoa documentation, you simply enable the “Developer” plugin, that will take care of everything.

For Java, do what this blog entry describes :-)

Posted by Igor on 21 Oct 2006 00:18

This is a great tip! Thnx

Posted by Marc on 21 Oct 2006 00:19

Igor: Glad you liked it, thanks for *your* great tip about NetBeans font sizes at http://net3x.blogspot.com/2006/10/changing-font-size-in-netbeans.html. This has been bothering me for a while.

I'll add this to my NetBeans-on-Mac customization blog entry.

Posted by Sven on 11 Nov 2006 00:54

Thx a lot !

Posted by Sven on 11 Nov 2006 00:55

I'm a student in programming, and just bought a new Mac. Quicksilver seams to be THE solution to the unsophisticated Finder.

But I was wondering how I can get the Cocoa and Java API downloaded on my Mac. Or is it already there ?

Posted by Paul on 13 Jan 2007 02:14

Marc, this is a total aside, but I'd love to hear more about your switch from LaunchBar to QuickSilver at some point. As a longstanding LB devotee who has tried QS and found it good, but a bit rough, I've had a hard time finding QS fans whose arguments didn't boil down to, "I haven't used Launchbar but Quicksilver is AWESOME dude and it's free!" Whereas your opinion carries a lot of weight.

Posted by Marc on 13 Jan 2007 11:07

Paul: They are really quite close. It was mostly the plugin system and a few more features. I believe at the time there was no way to interact with text or Finder file selection, or do things like QuickSilvers "Grab" operation (Cmd-space and select an app, then hit Cmd-Option-G to change the operation so it opens the current finder selection). I like the whole subject-verb-object thing.

The plugin system seems interesting because I don't have to wait for the developers to add a feature I need. Someone else can add it.

My impression is that if you just want it to work, you should use LaunchBar. It has an extremely short learning curve and excellent defaults.

If you want to tweak and have more operations (at the cost of memorizing more stuff), look at QuickSilver.

Powered By blojsom