The Trolltech Qt Assistant is designed so it can be used not only for Qt, but for any html based documentation. Assistant needs an xml-like content file to locate and create an index for documentation. The details on how to customize Assistant can be found here.
javadocqtassist is an utility that parses Java html documentation, extracts class and method names and creates the content file for Assistant. The list of things you need is short:
- Qt or you might want to try QtJambi
- Any Java documentation on your hard drive
- javadocqtassist.jar
Suppose you have J2SE documentation set in ~/documentation/j2se/docs. By the default javadocqtassist will create a content file in the current directory, but you can specify the output path.
java -jar javadocqtassist.jar ~/documentation/j2se/docs/api -outputPath \
~/documentation -fileName javadoc.dcf -title J2SE
Note that you need to specify the path to the directory the contains API, usually it is called api. Depending on the size of the documentation it might take a few minutes to complete. Expect 5 - 10 minutes for the whole J2SE set. Upon completion javadoc.dcf file will be created in ~/documentation directory. Now you have to specify the location of new content file for Qt Assistant. Do not move the generated content file to another directory, because it uses relative paths to the actual documentation location.
/usr/local/Trolltech/Qt-4.2.0/bin/assistant -addContentFile ~/documentation/javadoc.dcf
Then just run Qt Assistant.
/usr/local/Trolltech/Qt-4.2.0/bin/assistant
After it is started you should see a new item in the tree with the name J2SE. You can also use powerful indexing, bookmarking and full text searching capabilites. If you want to have your own documentation set without the default Qt documentation, you have to modify javadoc.dcf and rename it so it has .adp extension. It is explained in Qt Assistant documentation. You can also specify -newProfile option when you run javadocqtassist
java -jar javadocqtassist.jar ~/documentation/j2se/docs/api -outputPath \
~/documentation -newProfile -fileName javadoc.adp -title J2SE
Then you need to run assistant with the new profile.
/usr/local/Trolltech/Qt-4.2.0/bin/assistant -profile ~/documentation/javadoc.adp
Now you will have only one item in the tree. You can add another documentation set in your profile. Suppose you have J2EE documentation in ~/documentation/j2ee/docs. Run:
java -jar javadocqtassist.jar ~/documentation/j2ee/docs/api -addToProfile \
~/documentation/javadoc.adp -title J2EE
Then start Qt Assistant.
/usr/local/Trolltech/Qt-4.2.0/bin/assistant -profile ~/documentation/javadoc.adp
Now you will have both J2SE and J2EE items in the tree.
I wrote my examples in Linux, but it works the same way in the Windows OS. I've tried some of the latest documentation sets, such as J2SE 1.4 and 1.5. I'm not sure if older versions of javadoc tool produced different html.
Downloads:
Binary version javadocqtassist.jar
Source code javadocqtassist.zip
Send comments to Sergejs Melderis at sergey dot melderis at gmail dot com