简体   繁体   中英

How to get JavaDoc for Eclipse plug-in development?

I just started with developing plug-ins for Eclipse but whenever I create one of the sample projects there is no JavaDoc for the methods that are used in the generated code.

I'm using the HelloWorld example and in there there's for example this generated code:

public void run(IAction action) {
  MessageDialog.openInformation(
    window.getShell(),
    "Miau",
    "Hello, Eclipse world");
}

However the openInformation() method does not have any JavaDoc attached neither does MeesageDialog or any other class/method/interface used in the generated example.

Is there a way to add JavaDoc to those methods/classes/etc?

Whether JavaDoc is available depends how you set up your target platform . Source bundles or source features are necessary in order for the IDE to provide JavaDoc.

Moreover, sources allow to debug step through the platform code, look into the source if the documentaion isn't clear enough, etc. Hence, you will probably always want to have the sources.

If you add components to your target platform from a software site, make sure that the Include source if available option is checked.

When selecting components, prefer SDK features or also include Resource features. For example, include the Eclipse Platform SDK instead of the Eclipse Platform as it also contains source code and documentation. If your target requires the Eclipse Java Development Tools , make sure to also include the Eclipse JDT Plug-in Developer Resources , again the latter contains documentation and source code.

添加内容对话框

I thought the location was configured to the java site by default for working when online. If you want to have the documentation offline, do this:

First download and extract the javadocs for the JRE version you have installed.

From Eclipse go Windows -> Preferences -> Expand Java -> Installed JREs -> Select the JRE you want docs for -> Click Edit -> Select all of the System Libraries -> Click JavaDoc location and select the location where you extracted the docs.

*EDIT - Just noticed the method you are looking at isn't in core java. If you want to add Java Docs or Source to a referenced library, expand the references then right-click on the jar you want and select preferences, from there you can add the docs or source, which you should be able to download.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM