xtofl
xtofl

Reputation: 41509

How to find what interface a method is for in Eclipse

I have a class implementing a number interfaces . Part of it looks like this:

class Z implements A, B, C, ... {
  @override
  public void foo( Bar b ) {
      ...
  }

Is there a way, preferrably a shortcut, to ask Eclipse what interface the method foo is from?

(Note: using Eclipse version Juno)

Upvotes: 0

Views: 155

Answers (3)

Priyank Doshi
Priyank Doshi

Reputation: 13151

Press CTRL+ F3 + F3 from anywhere in the class. Here foo1 is from Inter1 and foo2 is from Inter2. enter image description here

Update: (for reference)

public class Impl implements Inter1, Inter2 {

    @Override
    public void foo() {
    // TODO Auto-generated method stub

    }

    @Override
    public void foo1() {
    // TODO Auto-generated method stub

    }

}

public interface Inter1 {
    void foo1();
}

public interface Inter2 {
    void foo2();
}

Upvotes: 4

Amol Fasale
Amol Fasale

Reputation: 942

Try this, really helpfull...

Press Ctrl+f3+f3

Upvotes: 0

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272507

There should be a little up arrow in the margin next to your method override. Click on that.

I'm not sure if there's an associated keyboard shortcut.

Upvotes: 5

Related Questions