如何在Eclipse中获取SWT和JFace的JavaDoc ?

时间:2022-11-11 17:22:02

I'm a newbie to Eclipse and can't figure out how to get the JavaDocs for SWT and JFace to show up when I am editing.

我是Eclipse的新手,不知道如何在编辑时获取SWT和JFace的JavaDocs。

How do I do this? Thanks!

我该怎么做呢?谢谢!

7 个解决方案

#1


6  

I assume you've dowloaded the jars yourself and referenced them in your project. If so, you can right click the jar in the project explorer (in the 'Referenced Libraries' node) and click 'Properties'. The window that appears you can define the location of the jar's JavaDoc and source, if you have those available.

我假设您已经将jar装载到您的项目中并引用它们。如果是这样,您可以在project explorer中(在“引用库”节点中)单击jar,然后单击“属性”。如果您有这个窗口,那么您可以定义jar的JavaDoc和源代码的位置。

You can also reach this by clicking Project > Properties > Java Build Path > Libraries and expanding the node for the jar to which you want to add javadoc/source.

您还可以通过单击Project >属性> Java构建路径>库和扩展jar的节点来达到这个目的,您希望添加javadoc/source。

Also worth mentioning that if you use Maven (http://maven.apache.org/) for building your project, it's dependency management system will take care of finding sources and javadocs for you. But that's a different topic entirly. Also might be worth looking at Ivy (http://ant.apache.org/ivy/) - similar dependency management system, but can be used without selling your soul to Maven, I'm told.

同样值得一提的是,如果您使用Maven (http://maven.apache.org/)来构建您的项目,它的依赖管理系统将负责为您查找源代码和javadocs。但这是一个不同的主题。也可能值得关注Ivy (http://ant.apache.org/ivy/)——类似的依赖管理系统,但可以在不向Maven出售您的灵魂的情况下使用它。


You might also mean that you can't actually see the javadocs: Window > Show View > Other... > Java > JavaDoc. This view will show you the javadoc for whatever is currently in focus. Or just mouse over a method to see the javadoc in a popup.

您还可能意味着您实际上看不到javadocs: Window >显示视图>其他…> Java > JavaDoc。这个视图将显示当前焦点的javadoc。或者只是鼠标经过一个方法来查看弹出窗口中的javadoc。

#2


3  

Following the advice from ukulele, I was able to right click on the jar and set the javadoc location. In this case the location for the online javadoc was:

根据ukulele的建议,我可以右键单击jar并设置javadoc位置。在这种情况下,在线javadoc的位置是:

http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/

http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/

Found from the SWT website:

从SWT网站找到:

http://www.eclipse.org/swt/docs.php

http://www.eclipse.org/swt/docs.php

Thanks!

谢谢!

#3


1  

If you use a "Plug-in Project" they are there by default. That project type is available in "Eclipse for RCP/Plug-in Developers" or "Eclipse Classic". If you have a different version, you should be able to set up such a project after installing the "Eclipse SDK" feature via the update manager (in 3.4 under Available Software -> The Eclipse Project Updates).

如果您使用的是“插件项目”,默认情况下它们是存在的。该项目类型在“Eclipse for RCP/插件开发人员”或“Eclipse Classic”中可用。如果您有一个不同的版本,您应该能够在通过更新管理器(在可用的软件->,Eclipse项目更新)中安装“Eclipse SDK”特性之后,设置这样一个项目。

#4


1  

I often find the javadoc at eclipse.org to be really really slow to load. The javadocs may be included with your eclipse install and thus be available locally; try Help->Help Contents menu and search for 'SWT' to see if this is true on your installation.

我经常在eclipse.org上找到javadoc,它的加载速度非常慢。javadocs可能包含在您的eclipse安装中,因此可以在本地使用;试试Help->帮助内容菜单,并搜索“SWT”,看看在安装过程中是否正确。

#5


1  

One way is to attach the SWT source jar (for example org.eclipse.swt.gtk.linux.x86_64.source_3.7.0.v3735b.jar) from the eclipse/plugins directory to the referenced library. You'll be able to view both the source and the Javadoc.

一种方法是将SWT源jar(例如,org. eclipse.swt.gtk.linux.x86_64.3.7.0.v3735b .jar)从eclipse/plugins目录连接到引用的库。您将能够同时查看源代码和Javadoc。

Found on Eclipse Community Forums: Standard Widget Toolkit (SWT) » JavaDocs.

在Eclipse社区论坛上找到:标准小部件工具包(SWT)»JavaDocs。

#6


1  

Install the 'Eclipse SDK' if you want JavaDoc for everything(including plugins) installed in Eclipse. The update site for this is

如果您想要JavaDoc在Eclipse中安装的所有东西(包括插件),安装“Eclipse SDK”。这是更新站点。

download.eclipse.org/eclipse/updates/4.4  

(this is for eclipse juno. for kepler use version number 4.3 instead of 4.4)
Go to Help > Install New Software... and give the above url for "work with" section. Then you should select the "Eclipse SDK" and install it.
After the installation and restarring eclipse all the docs will be visible in your editor whenever you hover with mouse over a special keyword.
Trust me this is the easiest and 100% correct method.

(这是为eclipse juno准备的。对于开普勒使用的版本号4.3而不是4.4)去帮助>安装新的软件…并将上面的url用于“与”部分的“工作”。然后,您应该选择“Eclipse SDK”并安装它。在安装和重新启用eclipse之后,当您用鼠标悬停在一个特殊的关键字上时,所有的文档都将在您的编辑器中可见。相信我,这是最简单也是百分百正确的方法。

For further clarification What will happen in this is it will configure the javadoc path for "org.eclipse.swt.gtk.linux.x86_64_3.102.1.v20140206-1358.jar" and "org.eclipse.swt_3.102.1.v20140206-1334.jar"(or in windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar) and which are visible in plugin dependencies of the project structure appropriately. So to manually set the javadoc support right click project>Build path>configure build path>under libraries tab>plugin dependencies select the .jar related to the swt(for windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar and for linux org.eclipse.swt.gtk.linux.x86_64_xxxxxxx.jar) expand it and set the javadoc location. For the java doc location you should give the the archive path of org.eclipse.platform.doc.isv_4.3.0.v20130606-0003.jar as "\Eclipse-Kepler\eclipse\plugins\org.eclipse.platform.doc.isv_4.3.2.v20140205-0929.jar" which is located in PATH_TO_ECLIPSE_FOLDER\eclipse\plugins (if this file is not there, u should put it there). U should give reference/api as the path within archive.

为了进一步说明这一点,它将为“org.eclipse.swt.gtk.linux.x86 _64_ 3.102.1.v20140206-1358配置javadoc路径”。jar”和“org.eclipse.swt_3.102.1.v20140206 - 1334。在项目结构的插件依赖项中可以看到这一点。因此,要手动设置javadoc支持,请单击项目>构建路径>配置构建路径>在库标签>插件依赖项下选择与swt相关的.jar(用于windows org.eclipse.swt.win32.win32. win32.x86_643.xxxx)。扩展它并设置javadoc位置_64_。对于java doc位置,您应该提供org. eclipse.platform.doc.doc.isv_4.3.0 .v20130606-0003的归档路径。jar“\ Eclipse-Kepler \ eclipse \ plugins \ org.eclipse.platform.doc.isv_4.3.2.v20140205 - 0929。jar位于PATH_TO_ECLIPSE_FOLDER\eclipse\plugins(如果这个文件不在那里,你应该把它放在那里)。您应该将引用/api作为归档中的路径。

#7


0  

In case you are developing with org.eclipse.jface.text, also edit the org.eclipse.jface.text jar's javadoc location to:

如果您正在开发的是org.eclipse.jface。文本,也编辑org.eclipse.jface。文本jar的javadoc位置:

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/

#1


6  

I assume you've dowloaded the jars yourself and referenced them in your project. If so, you can right click the jar in the project explorer (in the 'Referenced Libraries' node) and click 'Properties'. The window that appears you can define the location of the jar's JavaDoc and source, if you have those available.

我假设您已经将jar装载到您的项目中并引用它们。如果是这样,您可以在project explorer中(在“引用库”节点中)单击jar,然后单击“属性”。如果您有这个窗口,那么您可以定义jar的JavaDoc和源代码的位置。

You can also reach this by clicking Project > Properties > Java Build Path > Libraries and expanding the node for the jar to which you want to add javadoc/source.

您还可以通过单击Project >属性> Java构建路径>库和扩展jar的节点来达到这个目的,您希望添加javadoc/source。

Also worth mentioning that if you use Maven (http://maven.apache.org/) for building your project, it's dependency management system will take care of finding sources and javadocs for you. But that's a different topic entirly. Also might be worth looking at Ivy (http://ant.apache.org/ivy/) - similar dependency management system, but can be used without selling your soul to Maven, I'm told.

同样值得一提的是,如果您使用Maven (http://maven.apache.org/)来构建您的项目,它的依赖管理系统将负责为您查找源代码和javadocs。但这是一个不同的主题。也可能值得关注Ivy (http://ant.apache.org/ivy/)——类似的依赖管理系统,但可以在不向Maven出售您的灵魂的情况下使用它。


You might also mean that you can't actually see the javadocs: Window > Show View > Other... > Java > JavaDoc. This view will show you the javadoc for whatever is currently in focus. Or just mouse over a method to see the javadoc in a popup.

您还可能意味着您实际上看不到javadocs: Window >显示视图>其他…> Java > JavaDoc。这个视图将显示当前焦点的javadoc。或者只是鼠标经过一个方法来查看弹出窗口中的javadoc。

#2


3  

Following the advice from ukulele, I was able to right click on the jar and set the javadoc location. In this case the location for the online javadoc was:

根据ukulele的建议,我可以右键单击jar并设置javadoc位置。在这种情况下,在线javadoc的位置是:

http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/

http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/

Found from the SWT website:

从SWT网站找到:

http://www.eclipse.org/swt/docs.php

http://www.eclipse.org/swt/docs.php

Thanks!

谢谢!

#3


1  

If you use a "Plug-in Project" they are there by default. That project type is available in "Eclipse for RCP/Plug-in Developers" or "Eclipse Classic". If you have a different version, you should be able to set up such a project after installing the "Eclipse SDK" feature via the update manager (in 3.4 under Available Software -> The Eclipse Project Updates).

如果您使用的是“插件项目”,默认情况下它们是存在的。该项目类型在“Eclipse for RCP/插件开发人员”或“Eclipse Classic”中可用。如果您有一个不同的版本,您应该能够在通过更新管理器(在可用的软件->,Eclipse项目更新)中安装“Eclipse SDK”特性之后,设置这样一个项目。

#4


1  

I often find the javadoc at eclipse.org to be really really slow to load. The javadocs may be included with your eclipse install and thus be available locally; try Help->Help Contents menu and search for 'SWT' to see if this is true on your installation.

我经常在eclipse.org上找到javadoc,它的加载速度非常慢。javadocs可能包含在您的eclipse安装中,因此可以在本地使用;试试Help->帮助内容菜单,并搜索“SWT”,看看在安装过程中是否正确。

#5


1  

One way is to attach the SWT source jar (for example org.eclipse.swt.gtk.linux.x86_64.source_3.7.0.v3735b.jar) from the eclipse/plugins directory to the referenced library. You'll be able to view both the source and the Javadoc.

一种方法是将SWT源jar(例如,org. eclipse.swt.gtk.linux.x86_64.3.7.0.v3735b .jar)从eclipse/plugins目录连接到引用的库。您将能够同时查看源代码和Javadoc。

Found on Eclipse Community Forums: Standard Widget Toolkit (SWT) » JavaDocs.

在Eclipse社区论坛上找到:标准小部件工具包(SWT)»JavaDocs。

#6


1  

Install the 'Eclipse SDK' if you want JavaDoc for everything(including plugins) installed in Eclipse. The update site for this is

如果您想要JavaDoc在Eclipse中安装的所有东西(包括插件),安装“Eclipse SDK”。这是更新站点。

download.eclipse.org/eclipse/updates/4.4  

(this is for eclipse juno. for kepler use version number 4.3 instead of 4.4)
Go to Help > Install New Software... and give the above url for "work with" section. Then you should select the "Eclipse SDK" and install it.
After the installation and restarring eclipse all the docs will be visible in your editor whenever you hover with mouse over a special keyword.
Trust me this is the easiest and 100% correct method.

(这是为eclipse juno准备的。对于开普勒使用的版本号4.3而不是4.4)去帮助>安装新的软件…并将上面的url用于“与”部分的“工作”。然后,您应该选择“Eclipse SDK”并安装它。在安装和重新启用eclipse之后,当您用鼠标悬停在一个特殊的关键字上时,所有的文档都将在您的编辑器中可见。相信我,这是最简单也是百分百正确的方法。

For further clarification What will happen in this is it will configure the javadoc path for "org.eclipse.swt.gtk.linux.x86_64_3.102.1.v20140206-1358.jar" and "org.eclipse.swt_3.102.1.v20140206-1334.jar"(or in windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar) and which are visible in plugin dependencies of the project structure appropriately. So to manually set the javadoc support right click project>Build path>configure build path>under libraries tab>plugin dependencies select the .jar related to the swt(for windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar and for linux org.eclipse.swt.gtk.linux.x86_64_xxxxxxx.jar) expand it and set the javadoc location. For the java doc location you should give the the archive path of org.eclipse.platform.doc.isv_4.3.0.v20130606-0003.jar as "\Eclipse-Kepler\eclipse\plugins\org.eclipse.platform.doc.isv_4.3.2.v20140205-0929.jar" which is located in PATH_TO_ECLIPSE_FOLDER\eclipse\plugins (if this file is not there, u should put it there). U should give reference/api as the path within archive.

为了进一步说明这一点,它将为“org.eclipse.swt.gtk.linux.x86 _64_ 3.102.1.v20140206-1358配置javadoc路径”。jar”和“org.eclipse.swt_3.102.1.v20140206 - 1334。在项目结构的插件依赖项中可以看到这一点。因此,要手动设置javadoc支持,请单击项目>构建路径>配置构建路径>在库标签>插件依赖项下选择与swt相关的.jar(用于windows org.eclipse.swt.win32.win32. win32.x86_643.xxxx)。扩展它并设置javadoc位置_64_。对于java doc位置,您应该提供org. eclipse.platform.doc.doc.isv_4.3.0 .v20130606-0003的归档路径。jar“\ Eclipse-Kepler \ eclipse \ plugins \ org.eclipse.platform.doc.isv_4.3.2.v20140205 - 0929。jar位于PATH_TO_ECLIPSE_FOLDER\eclipse\plugins(如果这个文件不在那里,你应该把它放在那里)。您应该将引用/api作为归档中的路径。

#7


0  

In case you are developing with org.eclipse.jface.text, also edit the org.eclipse.jface.text jar's javadoc location to:

如果您正在开发的是org.eclipse.jface。文本,也编辑org.eclipse.jface。文本jar的javadoc位置:

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/