如何从Eclipse中的界面导航到实现类? [英] How to navigate to implementing class from interface in Eclipse?

查看:215
本文介绍了如何从Eclipse中的界面导航到实现类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有:

interface Foo {
  void doStuff();
}

class FooImpl implements Foo {
  public void doStuff() {
    // stuff
  }
 }

当我在代码中看到 myFoo.doStuff()时,如果我的光标超过了 doStuff(),按F3将带我到界面<$中的 doStuff() C $ C>富。当然,我经常对这种方法的实现感兴趣得多,而不仅仅是签名。

When I see myFoo.doStuff() in my code, if my cursor is over doStuff(), pressing F3 will take me to the doStuff() method in the interface Foo. Of course, I often am much more interested in the implementation of this method, not just the signature.

Eclipse有一种简单的方法,可以从方法声明中导航在实现类中实现该方法的接口?

Does Eclipse have an easy way to navigate from a declaration of a method in an interface to the implementation of that method in the implementing class?

在我的情况下,实现类不会有歧义。

In my case, there will not be ambiguity about what the implementing class is.

推荐答案

突出显示方法名称,然后按 CTRL T F4 。您将看到类型层次结构,但链接到方法而不是包含类。选择所需的实施类。

Highlight the method name, and press either CTRLT or F4. You'll see a type hierarchy, but linked to the method rather than the containing classes. Select the desired implementation class.

这篇关于如何从Eclipse中的界面导航到实现类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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