Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 52894

Summary: Need an extension to expose plug-in javadoc
Product: [Eclipse Project] PDE Reporter: Frederic Plante <fplante>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cn, crivet, daniel_megert, dirk_baeumer, dkhodges, eclipse-bugs, ed.burnette, erich_gamma, jeem, jose, lauzon, martinae, oyvind.harboe, patmc, philippe_mulet, stefan.baier, vineet, vladimir
Version: 3.0   
Target Milestone: 3.2 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 103261    
Attachments:
Description Flags
javadoc extension point none

Description Frederic Plante CLA 2004-02-23 23:14:44 EST
An extension similar to org.eclipse.pde.core.source should be exposed for plug-
ins exposing javadoc. 41421 makes this feature even more useful.
Comment 1 Pascal Rapicault CLA 2004-02-24 12:27:39 EST
I'm not sure I understand what you want to do with it, could you give more 
details please.
For now, the java doc is gathered into one plugin to be referenced from the 
help system.
Comment 2 Frederic Plante CLA 2004-02-24 13:51:32 EST
The org.eclipse.pde.core.source extension is used by the PDE to associate 
source files with a plug-in's .jars without user input. The JDT makes use of 
this information for javadoc hover and debugging for instance. 

The JDT also allows for the association of javadoc with a .jar. My 
understnading is that this is used for the "Open External Javadoc" JDT 
feature. To make use of this feature, users currently have to find and 
manually make the link form the plug-in's .jars to the plug-in's javadoc. This 
is not obvious for product users which are generally new to Eclipse 
development. Having an extension point similar to source, but that exposes 
javadoc would be useful to avoid such manual steps.

Also, if 41421 is fixed, this extension would allow Eclipse based products to 
expose APIs without the need to provide source files. (needed to leverage the 
javadoc hovers of the JDT Java editor)
Comment 3 Wassim Melhem CLA 2004-02-25 21:12:19 EST
*** Bug 29390 has been marked as a duplicate of this bug. ***
Comment 4 Wassim Melhem CLA 2004-03-06 11:58:06 EST
*** Bug 21587 has been marked as a duplicate of this bug. ***
Comment 5 Wassim Melhem CLA 2004-03-23 22:17:55 EST
*** Bug 39312 has been marked as a duplicate of this bug. ***
Comment 6 Pat McCarthy CLA 2004-04-09 22:44:12 EDT
Should there be a default location as well as an extension point that allows 
for location definition?  

Given abc.jar, if the abcsrc.zip is there it is assumed to be the source zip.

If say a certain zip or dir (\doc or \javadoc) was assumed to contain the 
javadoc, that might be nice a well.  Javadoc export defaults to the \doc dir, 
that seems like a possible choice.

Regardless of technique, this function will be very useful for teams that need 
to share API but not source when building or extending eclipse-based products. 
This has come up in discussions of late.
Comment 7 Wassim Melhem CLA 2004-04-10 17:19:28 EDT
Jim,
Currently, there is no clear/standard way to map plug-ins to the javadoc 
locations, which is why PDE can't do anything about it and the user has to do 
it manually.  This is tedious and would take a very long time because you have 
to do it for every single library.

We need to come up with guidelines for Eclipse on how to locate the javadoc 
for a plug-in's library.  One idea would be to expand the grammar of the 
org.eclipse.pde.core.source extension point to allow the specification of a 
javadoc location as well as a source code location.

This decision should be done at the product level, of course.  What are your 
thoughts?
Comment 8 Jim des Rivieres CLA 2004-04-13 12:49:42 EDT
It should be possible to provide a way for parties to contribute known 
locations of plug-in Javadoc. There are, however, a couple of complications:
(1) Javadoc may be pooled; for example, the Javadoc for all Platform plug-ins 
are generated at the same time, and stored in the same place.
(2) a Javadoc doc tree may be deep inside a help book. For example, the 
Platform Java doc tree is at
eclipse/plugins/org.eclipse.platform.doc.isv/doc.zip#reference/api/
(I'm don't believe that the existing JDT Javadoc support can handle Javadoc in 
a zip, much less deep inside one.)

One good thing that we can capitalize on is that Javadoc doc trees are self-
identifying - the package-list file contains the list of all packages 
documented in that doc tree. So the basic requirment would be for an extension 
point to which parties could contribute the locations of Javadoc doc trees 
relevant to certain plug-ins. Unclear to me how much anyone needs to know 
exactly which plug-ins are covered.


Comment 9 Martin Aeschlimann CLA 2004-04-13 13:16:05 EDT
JDT allows to have javadoc documentation in archives.
To configure this you would set an URL like
'jar:file:/C:/..../doc.isv_3.0.0/doc.zip!/references/api/' 
Comment 10 Wassim Melhem CLA 2004-04-13 13:53:26 EDT
>Unclear to me how much anyone needs to know exactly which plug-ins are 
>covered.
It does not have to be done on a per-plugin basis.  If the javadoc for all the 
plug-ins in a feature are in the same ZIP file, then all we need to do is 
declare the location of that one ZIP, and the path inside that ZIP where 
reference APIs can be found.  We already do the same thing for source code 
locations where we declare on source location for all the JDT plug-ins.

The problem is that, currently, the javadoc, when shipped separately, is in a 
seemingly arbitrary plug-in.  For example, for JDT, it 
is "org.eclipse.jdt.doc.isv".  So we need a standard way to do this, so that 
PDE can find it.  Is it always going to be a separate plug-in?  If so, where 
do we specify that information?  in the current pde.core.source extension?  do 
we create a new extension point?
Comment 11 Jim des Rivieres CLA 2004-04-13 14:25:33 EDT
It may be easier to create a new extension point especially for contributing 
Javadoc trees for plug-ins. The doc plug-ins that contain a Javadoc doc tree 
would be free to contribute theirs:
- org.eclipse.platform.doc.isv plug-in would contribute doc.zip!/reference/api
- org.eclipse.jdt.doc.isv plug-in would contribute doc.zip!/reference/api
- org.eclipse.pde.doc.user plug-in would contribute doc.zip!/reference/api
Comment 12 Wassim Melhem CLA 2004-04-27 16:08:47 EDT
Unfortunately, this item will have to be dropped from the 3.0 plan.
Too late in the game to introduce a new  extension point.
Comment 13 Wassim Melhem CLA 2004-06-09 23:36:54 EDT
*** Bug 66343 has been marked as a duplicate of this bug. ***
Comment 14 Wassim Melhem CLA 2004-07-19 09:58:14 EDT
*** Bug 70300 has been marked as a duplicate of this bug. ***
Comment 15 Wassim Melhem CLA 2004-09-05 22:52:04 EDT
Resurrecting for 3.1
cc Erich because it is on his wish list.
Comment 16 Wassim Melhem CLA 2004-09-14 09:33:34 EDT
*** Bug 73852 has been marked as a duplicate of this bug. ***
Comment 17 Wassim Melhem CLA 2004-11-02 22:57:13 EST
ok, we have a problem.

the PDE classpath computation takes place in org.eclipse.pde.core, which is a 
non-UI plugin.  Therefore, we cannot use JavaUI.setJavadocLocation(...).

Martin/Philippe, is there an equivalent function in JDT/Core?
Comment 18 Wassim Melhem CLA 2004-11-09 04:09:17 EST
where, oh where, is Martiiin?
Comment 19 Wassim Melhem CLA 2005-07-04 20:57:02 EDT
*** Bug 96747 has been marked as a duplicate of this bug. ***
Comment 20 Dirk Baeumer CLA 2005-07-05 04:34:10 EDT
Wassim, Javadoc locations are now stored as attributes in a class path entry. So
no UI needed anymore.
Comment 21 Wassim Melhem CLA 2005-07-07 00:29:36 EDT
dirk, what are we going to do about imported plugins (both binary and with 
source)?
The javadoc for the libraries of imported plugins will have to be hardcoded 
into the lib entries of the .classpath file, and it appears as though JDT only 
supports absolute file URLs.  So we can't use the roving ECLIPSE_HOME variable.

Javadoc for libraries referenced by the PDE container will work fine of course 
since the container is dynamic.

Comment 22 Martin Aeschlimann CLA 2005-07-07 03:52:45 EDT
Tthe javadoc location can currently only be specified for types in archives. For
types in source, you would still need jdt.ui API (it is set for the whole
project, not per source folder). But opeing external Javadoc for types in source
is not so common.
At import time of a binary plugin, you would know the location and can use this.
This is not a good thing to do if this plugin is shared, but that's usually not
the case for binary plugins.
All other references should go through the PDE container.

Other things I'm not sure about:
The location you configure would be an address on the local help server, right?
I guess the problem there is just to know the port number.

Or maybe it can be set to a location on eclipse.org. This is the best solution
if you would use the Javadoc wizard on your source and want all references to
other plugins to be annotated with links.

Comment 23 Wassim Melhem CLA 2005-07-07 08:19:32 EDT
I don't need to worry about port numbers, etc.  For example, to set the 
javadoc location for org.eclipse.core.runtime, all I do is point the javadoc 
location to doc.zip!/reference/api inside the org.eclipse.platform.doc.isv 
plug-in.  Shift-F2 takes care of the rest.

Mapping a plug-in to a javadoc location is done via the new 
org.eclipse.pde.core.javadoc extension point.

My question was that for binary imported plug-ins, the javadoc location is 
going to be a hardcoded absolute file URL in the .classpath file.  Is that 
ok?  do we have a better alternative for imported plug-ins?
Comment 24 Wassim Melhem CLA 2005-07-13 08:56:45 EDT
The extension point (org.eclipse.pde.core.javadoc) is in.
I will attach the HTML version momentarily as a sneak preview.

As suggested in comment 6, we now also have a default location for javadoc, 
much like we do with source code locations.  The default location is 'doc/' at 
the root of a plug-in.

When PDE looks for javadoc for a plug-in, we first look in the default 
location (doc/).  If it's there, we use it.  Otherwise, we search through the 
available org.eclipse.pde.core.javadoc extensions looking for the one that 
contributes javadoc to this particular plug-in.
Comment 25 Wassim Melhem CLA 2005-07-13 08:57:58 EDT
Created attachment 24660 [details]
javadoc extension point
Comment 26 Wassim Melhem CLA 2005-07-13 09:08:38 EDT
Marking as fixed.

The issue in comment 21 with hardcoded paths in the .classpath file is a 
current JDT limitation in the javadoc support.  Ideally, classpath variables 
or the like should be supported when specifying the javadoc location, which 
JDT could then resolve before passing the URL to the Help system.

Comment 27 Dirk Baeumer CLA 2005-08-02 04:43:47 EDT
*** Bug 105725 has been marked as a duplicate of this bug. ***
Comment 28 Dirk Baeumer CLA 2005-08-19 11:59:24 EDT
*** Bug 107413 has been marked as a duplicate of this bug. ***
Comment 29 Wassim Melhem CLA 2005-09-01 13:24:22 EDT
*** Bug 108561 has been marked as a duplicate of this bug. ***