简体   繁体   中英

How to find the overridden method in Eclipse?

当我在eclipse中查看一个方法时,如何跳转到覆盖/扩展的方法?

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.

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:

截图

(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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM