跳转到Eclipse IDE中的接口实现 [英] Jump into interface implementation in Eclipse IDE

查看:212
本文介绍了跳转到Eclipse IDE中的接口实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你知道如何在Eclipse中按 F3 对方法进行声明吗?我有一个方法是接口的一部分;单击 F3 会自然地转到声明界面。

You know how in Eclipse, pressing F3 over a method will take you to its declaration? Well I have a method that is part of an interface; clicking F3 over this naturally takes me to the declaring interface.

显然有一个对象实现了这个接口,这就是方法的实际位置实现。我想,当我按 F3 时,跳转到实现,而不是接口声明。我知道在编译时可能不知道实现,所以有没有办法让Eclipse向我展示实现接口的所有类,以便我可以选择要查看的实现方法?现在当发生这种情况时,我只是手动搜索这个以找到实现的方法。

Obviously there is an object implementing this interface and this is where the method is actually implemented. I want, when I press F3, to jump to the implementation, not the interface declaration. I know that the implementation may not be known at compile-time, so is there a way for Eclipse to show me all the classes implementing the interface so that I can select which implemented method to view? Right now when this happens I am just manually searching for this to find the implemented method.

推荐答案

这是我的工作:


  • 在界面中,将光标移动到方法名称。按 F4 。 =>出现类型层次结构视图

  • 在视图的下半部分,应该已经选择了该方法。在其工具栏中,单击锁定视图并在层次结构中显示成员(应该是最左侧的工具栏图标)。

  • 在视图的上半部分,您可以浏览所有实现的方法。

  • In the interface, move the cursor to the method name. Press F4. => Type Hierarchy view appears
  • In the lower part of the view, the method should already be selected. In its toolbar, click "Lock view and show members in hierarchy" (should be the leftmost toolbar icon).
  • In the upper part of the view, you can browse through all implementations of the method.

程序不是很快,但它给你一个很好的概述。

The procedure isn't very quick, but it gives you a good overview.

这篇关于跳转到Eclipse IDE中的接口实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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