89

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

anjanb
  • 12,232
  • 18
  • 72
  • 104

3 Answers3

123

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
  • 71,889
  • 31
  • 184
  • 335
86

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
  • 8,586
  • 6
  • 44
  • 73
Zoe
  • 1,793
  • 1
  • 15
  • 18
24

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
  • 25,818
  • 15
  • 86
  • 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