如何让 Eclipse 显示一个类的整个 javadoc

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11840902/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:15:16  来源:igfitidea点击:

How do I get Eclipse to show the entire javadoc for a class

eclipse

提问by spotter

Can eclipse show the entire javadoc? i.e. all methods (and their descriptions), when i highlight an object reference?

eclipse可以显示整个javadoc吗?即所有方法(及其描述),当我突出显示对象引用时?

for example, if I do System, it shows me

例如,如果我执行 System,它会显示我

java.lang.System

The System class contains several useful class fields and methods. It cannot be instantiated.

Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.

Since: JDK1.0

java.lang.System

System 类包含几个有用的类字段和方法。它不能被实例化。

System 类提供的工具包括标准输入、标准输出和错误输出流;访问外部定义的属性和环境变量;一种加载文件和库的方法;以及一种用于快速复制数组一部分的实用方法。

从:JDK1.0

but that tells me very litte about what I can do with that. yes, I can use the intelligent dot completion, but that seems a bit cumbersome.

但这并没有告诉我我可以用它做什么。是的,我可以使用智能点补全,但这似乎有点麻烦。

any pointers would be appreciated.

任何指针将不胜感激。

回答by M. Abbas

To see the javadoc of a class having attached source in eclipse:

要查看在 Eclipse 中附加源的类的 javadoc:

select Window -> show view -> javadoc (or alt + shift + q, j).

选择窗口 -> 显示视图 -> javadoc(或 alt + shift + q, j)。

then in the javadoc view, right click -> open attached javadoc (or shift + F2), this will display the javadoc of the class in the internal browser of eclipse.

然后在javadoc视图中,右击->打开附带的javadoc(或shift+F2),这将在eclipse的内部浏览器中显示该类的javadoc。

回答by weberjn

In the source editorhover mouse over some method or class name.

在源代码编辑器中,将鼠标悬停在某个方法或类名称上。

Then press

然后按

Shift-F2 (Open External Documentation)

Javadoc View will open the full documentation at the right position.

Javadoc View 将在正确的位置打开完整的文档。

回答by abc

What you need to do is to hover mouse over some in-built method or class that are using in your program.

您需要做的是将鼠标悬停在程序中使用的某些内置方法或类上。

Hold ctrl on your keyboard and click. Then eclipse asks you to attach source. click on 'attach source', browse for src.zip file after choosing 'EXTRENAL' file. or instead give path for extracted src folder under same ie external file attachment.

按住键盘上的 ctrl 并单击。然后 eclipse 会要求您附加源代码。单击“附加源”,选择“外部”文件后浏览 src.zip 文件。或者改为在相同的外部文件附件下为提取的 src 文件夹提供路径。

Next time you hover over an in-built class or method it shows a small description. To view entire javadoc for same, keep holding ctrl and click on it.

下次您将鼠标悬停在内置类或方法上时,它会显示一个小说明。要查看相同的整个 javadoc,请按住 ctrl 并单击它。

It worked for me.

它对我有用。

回答by srivenky

If you have source attached to the classes (Both Java & custom) then you can see it in the Outline view by pressing F3.

如果您将源附加到类(Java 和自定义),那么您可以通过按 F3 在大纲视图中看到它。

回答by HariUserX

I know that this post is old. Nevertheless I would like to add a procedure for showing Javadoc in an easy way.

我知道这个帖子是旧的。尽管如此,我还是想添加一个以简单方式显示 Javadoc 的过程。

I use eclipse oxygen 4.7.1awhich is an year 2017build.

我使用的4.7.1a是一年2017构建的日食氧气。

-> Just hover over any declaration/method/object/class and press F2to focus and now at the bottom of the tooltip that appears, we can find icons/buttons that can take us to its Javadocin browser or eclipse view.

-> 只需将鼠标悬停在任何声明/方法/对象/类上并按下F2以聚焦,现在在出现的工具提示底部,我们可以找到可以将我们带到Javadoc浏览器或日食视图中的图标/按钮。

shift+F2directly opens the javadocof the entity you are hovering over, in a browser in the eclipse.

shift+F2javadoc在 Eclipse 的浏览器中直接打开您悬停在其上的实体的 。

For this method to work a javadocneeds to be attached to your source. See linking javadoc.

要使此方法起作用,javadoc需要将其附加到您的源。请参阅链接 javadoc