views:

82

answers:

3

Is there any way by which I can find out all classes which implement a particular interface? For example, if I have a interface as follows:

public interface myIntFac{}

I want to find all classes inside current project that implement this interface. How can I find it out in Eclipse?

+3  A: 

Place your cursor on the interface, and try Ctrl-T.

fastcodejava
+1  A: 

Put your cursor in myIntFac and press F4 to show the type hierarchy as a separate window, or Ctrl-T to show it as a pop-up. Personally I like the "separate window" approach as it makes it easier to browse, refocus on a different type etc - but if you only want to show the hierarchy very briefly, the pop-up is good too.

Jon Skeet
+6  A: 

At the interface level, you can use (assuming the cursor in on the interface)

  • CTRL+T to show the Quick Type Hierarchy
  • F4 to Open Type Hierarchy

At the method level, if you hover a method while holding down the control key, a pop-up box gives you the following choices:

  • Open Declaration
  • Open Implementation

alt text

And from anywhere, you can use:

  • CTRL+SHIFT+H to open the Open Type Hierarchy pop-up and search for any type/interface.
Pascal Thivent