简体   繁体   English

如何获得JavaDoc for Eclipse插件开发?

[英]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. 我刚开始为Eclipse开发插件,但每当我创建一个示例项目时,生成的代码中使用的方法都没有JavaDoc。

I'm using the HelloWorld example and in there there's for example this generated code: 我正在使用HelloWorld示例,例如这里生成的代码:

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. 但是, openInformation()方法没有附加任何JavaDoc,也没有MeesageDialog或生成的示例中使用的任何其他类/方法/接口。

Is there a way to add JavaDoc to those methods/classes/etc? 有没有办法将JavaDoc添加到那些方法/类/等?

Whether JavaDoc is available depends how you set up your target platform . JavaDoc是否可用取决于您设置目标平台的方式 Source bundles or source features are necessary in order for the IDE to provide JavaDoc. 为了让IDE提供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. 选择组件时,更喜欢SDK功能或包括资源功能。 For example, include the Eclipse Platform SDK instead of the Eclipse Platform as it also contains source code and documentation. 例如,包括Eclipse Platform SDK而不是Eclipse Platform ,因为它还包含源代码和文档。 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. 如果您的目标需要Eclipse Java开发工具 ,请确保还包括Eclipse JDT插件开发人员资源 ,后者包含文档和源代码。

添加内容对话框

I thought the location was configured to the java site by default for working when online. 我认为该位置默认配置为java站点,以便在线工作。 If you want to have the documentation offline, do this: 如果要使文档脱机,请执行以下操作:

First download and extract the javadocs for the JRE version you have installed. 首先下载并解压缩已安装的JRE版本的javadoc。

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. 从Eclipse转到Windows - >首选项 - >展开Java - >已安装的JRE - >选择您想要文档的JRE - >单击编辑 - >选择所有系统库 - >单击JavaDoc位置并选择解压缩文档的位置。

*EDIT - Just noticed the method you are looking at isn't in core java. *编辑 - 刚刚注意到你所看到的方法不在核心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. 如果要将Java Docs或Source添加到引用的库中,请展开引用,然后右键单击所需的jar并选择首选项,从那里可以添加应该能够下载的文档或源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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