How to find the overridden method in Eclipse?

柔情痞子 提交于 2019-12-03 16:22:42

问题


When I am looking at a method in eclipse java, how do I jump to the method it overrides/extends?


回答1:


Three ways to go about it.

Hyperlink Method (Mouse + Keyboard)

Press CTRL while hovering over the overriden method.

You should see an option called 'Open Super Implementation. Click it !

From here :

Keyboard shortcut

And for bonus points, you can setup a Keyboard shortcut to do this like so :

When you try to setup a keyboard shortcut, you may filter by typing Open Super Im. On my Eclipse Indigo three matches were found. I tried setting them one by one until the shortcut appeared in Navigate -> Open Super Implementation like so :

Mouse only - Using the vertical Ruler

Click the ovverride marker that appears in the Vertical Ruler as in the above snapshot.




回答2:


On the left edge of the editor there is a small triangle symbol next to the overwritten method. The tooltip tells you which superclass you are overwriting, clicking it leads you to the corresponding method.

Screenshot:




回答3:


(Indigo Release) Put cursor on the method name and press CTRL+T to jump to the types list, from there you can jump to the super method. If you then click CTRL+T again it expands the supertype hierarchy.



来源:https://stackoverflow.com/questions/11849631/how-to-find-the-overridden-method-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!