shortcut : how to get eclipse to go to the ONLY implementation of an interface's method

JavaEclipseKeyboard Shortcuts

Java Problem Overview


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

Java Solutions


Solution 1 - Java

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.

Solution 2 - Java

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

Solution 3 - Java

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:

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionanjanbView Question on Stackoverflow
Solution 1 - JavaThorbjørn Ravn AndersenView Answer on Stackoverflow
Solution 2 - JavaZoeView Answer on Stackoverflow
Solution 3 - JavadigitaljoelView Answer on Stackoverflow