Access to javadoc from library

My use case is simple, i want to access the javadoc of a class that is in a library. So, for this to be possible the library has to have either the javadoc url or file path configure, or the library sources.

I can see that to get the javadoc from the configured sources i have to use getNavigationElement.getDocComment.

I haven't figured out how to get the javadoc from the configured javadoc url or path.
Any ideas ?

Thanks.

5 comments

Hi Hugo,

Maybe I misunderstand you, but if it's is about the javadoc url/path itself, then you can get it with some code like:

LibraryTable libraryTable = ModuleRootManager.getInstance(module).getModifiableModel().getModuleLibraryTable();

for (Library library : libraryTable.getLibraries()) {
final String[] javadocUrls = library.getUrls(OrderRootType.JAVADOC);
}

N.B. I copied this from the source of the KonaWorks PowerPack plugin (available at http://plugins.intellij.net/plugin/?id=1144 ). Which might need a little upgrade (I just saw that it is configured to support builds up to 6500)

HTH,
Ruben

0

It's not about the url itself, i want to access the actual javadoc.

0

Hello Hugo,

My use case is simple, i want to access the javadoc of a class that is
in a library. So, for this to be possible the library has to have
either the javadoc url or file path configure, or the library sources.

I can see that to get the javadoc from the configured sources i have
to use getNavigationElement.getDocComment.

I haven't figured out how to get the javadoc from the configured
javadoc url or path. Any ideas ?


The only thing you can do is use JavaDocManager.getExternalJavaDocUrl() to
get the URL for the javadoc page to display. We don't build the javadoc PSI
from compiled HTML pages.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.