Geertjan's Blog

  • March 3, 2009

@inheritDoc and the NetBeans Platform

Geertjan Wielenga
Product Manager
Today's question of the day comes from Honza Pozivil, who writes the following about Javadoc: "If I use Lookup (org.openide.util.Lookup), I want it to be clickable and link to the NetBeans site. Right now, it doesn't create any
links to classes outside my project."

So, I downloaded the NetBeans sources from Mercurial and registered the main folder containing them like this, in the NetBeans Platform Manager:

That enabled me to use the "@inheritDoc" attribute, which works in the code completion, as you can see here:

However, when I create the Javadoc, via "Generate Javadoc" on the module, the inherited Javadoc is ignored. I.e., it isn't shown. Probably because it isn't found? And even though I have set "nbplatform.default.javadoc" in the build.properties file. And the "NetBeans API Documentation" module is installed.

PS: From the mailing list today, by Florian Brunner, this does a good job of getting the links to work correctly, though the "@inheritDoc" attribute is still not resolved.

<target name="javadoc" depends="build-init,-javadoc-init">
<mkdir dir="${netbeans.javadoc.dir}/${code.name.base.dashes}"/>
<javadoc destdir="${netbeans.javadoc.dir}/${code.name.base.dashes}"
<classpath refid="cp"/>
<sourcepath location="${src.dir}"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
<link href="http://bits.netbeans.org/6.5/javadoc/org-openide-util"/>

PS to my previous PS: If you change the sourcepath in the target above, to include the sources that should have their Javadoc inherited, such as here...

<sourcepath path="${src.dir};/home/geertjan/Desktop/main/nb_all/openide.util/src"/>

...then you will have the result you required at the start of this blog entry:


Join the discussion

Comments ( 3 )
  • Jesse Glick Tuesday, March 3, 2009

    The current javadoc target in the external module build harness makes no attempt to link to external Javadoc sets.

  • Geertjan Wielenga Tuesday, March 3, 2009

    Hi Jesse, it would be cool if it did so, along the lines expressed above. But no biggie if it doesn't, we need to add something along the above lines to the NetBeans Developer FAQ and then when anyone asks, they can be pointed to it.

  • Honza Pozivil Tuesday, March 3, 2009

    Thank you very much, Geertjan and Florian!

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.