92

If I'm in an interface and pointing to a method name, what can I do to quickly go to the ONLY implementation of that method?

Using Eclipse 3.6.

Lii
  • 11,553
  • 8
  • 64
  • 88
anjanb
  • 12,999
  • 18
  • 77
  • 106

4 Answers4

129

F3 is the typical "go to implementation". For interfaces that go to the interface definition.

Instead use Ctrl + T to see all implementations of the interface definition. You can then easily go to the one you want with the arrow keys and Enter. I believe that the first one is automatically selected so that Ctrl-T + Enter will do what you need.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
89

I just checked this on my Eclipse 3.6 install: Hold control (command on Mac), hover over the method name and select "Open Implementation".

You may assign a keyboard shortcut to this action by using Window > Preferences > General > Keys and searching for "Open Implementation".

zb226
  • 9,586
  • 6
  • 49
  • 79
Zoe
  • 1,833
  • 1
  • 16
  • 18
25

In the keymap (General > Keys) search for "open implementation" and map it to whatever you want. I chose Ctrl + Shift + I. Make sure you select "Editing Java Source" in the When box. I tested it, and having the cursor over the method name and pressing Ctrl + Shift + I took me directly to the implementation instead of showing the hierarchy that you get with Ctrl + T.

enter image description here

Also you can see an answer to a nearly identical question for other options:

Community
  • 1
  • 1
digitaljoel
  • 26,265
  • 15
  • 89
  • 115
  • 1
    Note that we can actually keep the original F3 key rather than having to invent some extra nonstandard key: if we assign F3 to "Open implementation" with "When = Editing Java Source", there is no conflict with the original F3 "Open declaration" with "When = In Windows" – Johan Boulé Feb 05 '19 at 15:53
  • Further note: "Ctrl + Shift + I" is already taken by the debugger's Inspect expression command. – Johan Boulé Feb 05 '19 at 16:25
0

If someone still need this information nowadays (Eclipse version 2022), to jump into interface method definition starting from an @Override method, now in Eclipse you can see on the left, next to the method signature, a little white triangle. By clicking on that you will jump to the implemented interface method. here an image of the little triangle

Oterwise, if you are on a interface method definition and you need to jump to one of the implementations, you must use CTRL+T shortcut to see the list of available implementations and than click on one of them.

Massimo
  • 137
  • 1
  • 4