如何在 Eclipse 中快速创建指向元素的 Javadoc 链接?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9908624/
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
How can I quickly create Javadoc links to elements in Eclipse?
提问by Jeff Axelrod
I want to easily create links to classes, methods, fields, etc. from within my Javadocs without having to type out the full expression e.g., {@link AllowAllHostnameVerifier}
.
我想从我的 Javadoc 中轻松创建到类、方法、字段等的链接,而无需输入完整的表达式,例如{@link AllowAllHostnameVerifier}
.
What is the fastest way to do this in Eclipse?
在 Eclipse 中执行此操作的最快方法是什么?
回答by Jeff Axelrod
If you don't already have a Javadoc for the element you're documenting, press
Shift+Alt+J.Using the
AllowAllHostnameVerifier
example, from within the Javadoc comment where you'd like the link, use autocomplete: TypeAAHV
then Ctrl+Space.Select
{@link AllowAllHostnameVerifier}
from the list of autocomplete options by pressing ↓then Enter.
如果您还没有要记录的元素的 Javadoc,请按
Shift+ Alt+ J。使用
AllowAllHostnameVerifier
示例,从您想要链接的 Javadoc 注释中,使用自动完成:AAHV
然后输入Ctrl+ Space。选择
{@link AllowAllHostnameVerifier}
按从自动完成选项列表↓,然后Enter。
回答by zedoo
As an addition, you can also create links to methods by using {@link #
Ctrl+Space for methods in the current class, or by using {@link ClassName#
+ Control Space for methods in ClassName.
此外,您还可以通过{@link #
对当前类中的方法使用Ctrl+Space 或{@link ClassName#
对 ClassName 中的方法使用+ Control Space创建到方法的链接。