在Eclipse中编写一条注释来链接特定的行 [英] Writing a comment in Eclipse linking a specific line

查看:106
本文介绍了在Eclipse中编写一条注释来链接特定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java中的Eclipse和长长的类,我需要一个这样的功能:在方法的顶部注释(例如)中,有一个方法执行的操作列表。
对于列出的每个操作,我想将注释的一部分超链接到相关代码的特定行。



然后使用Ctrl +点击该行,我可以直接跳转到指定的行代码。



可能这样的操作?



谢谢

解决方案

在下面的评论中你说:



< blockquote>

如何链接方法?


查看以下示例:您可以按< kbd> ctrl +点击 foo()的JavaDoc内的 bar(),eclipse跳转到方法 bar()

  public class Example {

/ **
* foo()的JavaDoc。这个方法执行{@link Example#bar()}
* /
public void foo(){
bar();
}

/ **
* bar()的Javadoc。
* /
public void bar(){}
}

Eclipse甚至为 @link ,类名和方法(手动输入)之后提供自动填充。 / p>

你在找什么?


i'm working with Eclipse in Java and with long long classes i need a feature like this: in the top comment of a method (for example) there is a list of operations executed by the method. For each operation listed, i'd like to "hyperlink" a portion of the comment to a specific line of the related code.

Then using Ctrl+Click to that line i can jump directly to the specified line code.

Is it possible an operation like this?

Thanks

解决方案

In the comment below your question you say:

how can i link methods?

Take a look at the following example: you can press ctrl + click on bar() within the JavaDoc of foo() and eclipse jumps to the method bar().

public class Example {

    /**
     * JavaDoc of foo(). This method executes {@link Example#bar()}
     */
    public void foo() {
        bar();
    }

    /**
     * Javadoc of bar().
     */
    public void bar() { }
}

Eclipse even offers autocomplete for @link, the classname and the method (after you manually entered the #).

Is that what you are looking for?

这篇关于在Eclipse中编写一条注释来链接特定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆