How to find the overridden method in Eclipse?
Asked Answered
P

3

22

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

Parrett answered 7/8, 2012 at 15:52 Comment(0)
D
38

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 :

enter image description here

Keyboard shortcut

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

enter image description here

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 :

enter image description here

Mouse only - Using the vertical Ruler

enter image description here

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

Dismal answered 7/8, 2012 at 15:53 Comment(1)
mille grazie, this is great!Cylindroid
Q
10

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:

Screenshot

Quintan answered 7/8, 2012 at 15:59 Comment(0)
P
2

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

Parrett answered 7/8, 2012 at 15:52 Comment(2)
This does not seem to work for me !! The quick type hierarchy only shows the sub-types and not the super-types !Dismal
I added, try ctrl+t again directly it should expand properly. This was for the Indigo release that I am using.Parrett

© 2022 - 2024 — McMap. All rights reserved.