简体   繁体   English

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

[英]How to get JavaDoc for SWT and JFace in Eclipse?

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的新手,无法弄清楚如何在编辑时让SWD和JFace的JavaDocs显示出来。

How do I do this? 我该怎么做呢? Thanks! 谢谢!

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'. 如果是这样,您可以右键单击项目资源管理器中的jar(在“Referenced Libraries”节点中),然后单击“Properties”。 The window that appears you can define the location of the jar's JavaDoc and source, if you have those available. 出现的窗口可以定义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. 您还可以通过单击“项目”>“属性”>“Java构建路径”>“库”并展开要添加javadoc / source的jar的节点来实现此目的。

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. 另外值得一提的是,如果您使用Maven( http://maven.apache.org/ )来构建项目,它的依赖管理系统将负责为您查找源代码和javadoc。 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. 也许值得看看常春藤( http://ant.apache.org/ivy/ ) - 类似的依赖管理系统,但是可以在不将你的灵魂卖给Maven的情况下使用,我被告知。


You might also mean that you can't actually see the javadocs: Window > Show View > Other... > Java > JavaDoc. 您可能还意味着您实际上无法看到javadoc:Window> Show View> Other ...> Java> JavaDoc。 This view will show you the javadoc for whatever is currently in focus. 此视图将显示当前焦点的任何内容的javadoc。 Or just mouse over a method to see the javadoc in a popup. 或者只是将鼠标悬停在某个方法上,即可在弹出窗口中查看javadoc。

Following the advice from ukulele, I was able to right click on the jar and set the javadoc location. 根据ukulele的建议,我能够右键单击jar并设置javadoc位置。 In this case the location for the online javadoc was: 在这种情况下,在线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! 谢谢!

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. 一种方法是将SWT源jar(例如org.eclipse.swt.gtk.linux.x86_64.source_3.7.0.v3735b.jar )从eclipse/plugins目录附加到引用的库。 You'll be able to view both the source and the Javadoc. 您将能够查看源和Javadoc。

Found on Eclipse Community Forums: Standard Widget Toolkit (SWT) » JavaDocs . Eclipse社区论坛上找到:标准窗口小部件工具包(SWT)»JavaDocs

Install the 'Eclipse SDK' if you want JavaDoc for everything(including plugins) installed in Eclipse. 如果您希望JavaDoc安装在Eclipse中安装的所有内容(包括插件),请安装“Eclipse SDK”。 The update site for this is 这个更新站点是

download.eclipse.org/eclipse/updates/4.4  

(this is for eclipse juno. for kepler use version number 4.3 instead of 4.4) (这是针对eclipse juno。对于kepler使用版本号4.3而不是4.4)
Go to Help > Install New Software... and give the above url for "work with" section. 转到“ Help > Install New Software...并为“使用”部分提供上述网址。 Then you should select the "Eclipse SDK" and install it. 然后你应该选择“Eclipse SDK”并安装它。
After the installation and restarring eclipse all the docs will be visible in your editor whenever you hover with mouse over a special keyword. 安装和重新设置eclipse之后,只要将鼠标悬停在特殊关键字上,所有文档都会在编辑器中显示。
Trust me this is the easiest and 100% correct method. 相信我这是最简单和100%正确的方法。

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. 为了进一步说明,将会发生的事情是它将为“org.eclipse.swt.gtk.linux.x86_64_3.102.1.v20140206-1358.jar”和“org.eclipse.swt_3.102.1.v20140206-1334”配置javadoc路径.jar“(或在windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar中),它们在项目结构的插件依赖项中可见。 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. 因此,要手动设置javadoc支持,请右键单击项目>构建路径>配置构建路径>在库选项卡>插件依赖项下,选择与swt相关的.jar(对于windows org.eclipse.swt.win32.win32.x86_643.xxxx.jar)对于linux org.eclipse.swt.gtk.linux.x86_64_xxxxxxx.jar)展开它并设置javadoc位置。 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). 对于java doc位置,您应该将org.eclipse.platform.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中(如果此文件不在那里,你应该把它放在那里)。 U should give reference/api as the path within archive. U应该将reference / api作为归档中的路径。

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". 该项目类型可在“Eclipse for RCP / Plug-in Developers”或“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 SDK”功能后设置这样的项目(在可用软件下的3.4中 - > Eclipse项目更新)。

I often find the javadoc at eclipse.org to be really really slow to load. 我经常发现eclipse.org上的javadoc真的很慢。 The javadocs may be included with your eclipse install and thus be available locally; javadoc可以包含在你的eclipse安装中,因此可以在本地使用; try Help->Help Contents menu and search for 'SWT' to see if this is true on your installation. 尝试帮助 - >帮助目录菜单并搜索“SWT”以查看您的安装是否属实。

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.text进行开发,还要将org.eclipse.jface.text 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/

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

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