tags:

views:

221

answers:

5

We have an interface that has a child interface. Ie:

public interface GenCalculator extends Serializable {}

public interface SpecialCalculator extends GenCalculator {}

In Eclipse, how can you find all interface-s that extend in this case GenCalculator?

If I right click, select "Open Type Hierarchy" in the GenCalculator interface, I only see classes that implement that GenCalculator interface. I want to see everything - those that implement and those that extend.

We're on Eclipse v.3.2.2.

+1  A: 

Ctrl-H brings up the search, go to Java search, and click "All Occurrences".

Dean J
It works. Also returns references to variables of type "GenCalculator" which I don't want (in this case). Would be nice to have easy right click option. Would have thought that would there.
Marcus
+1  A: 

Click on GenCalculator in the editor and press CTRL+T. You will see the quick complete hierarchy.

It is possible to have that aswell in the "Open Type Hierarchy" view, but you will have to switch the different options (button in the upper right corner).

vdr
+4  A: 

I would use Ctrl-T to get the descendants and then Ctrl-T again (see fine print in initial popup) if super interfaces/classes are wanted.

It is one of my most-used shortcuts.

Michael Easter
+1 this is the "right" way to do it
Pascal Thivent
This doesn't appear to tell me the interfaces that *extend* GenCalculator.
Marcus
If you put cursor on GenCalculator and hit Ctrl-T, it works for me in 3.2.2. I mocked up an example that uses interfaces (versus classes).
Michael Easter
+1  A: 

You can't do it in only one search.

May be you could use the "Text Search" option and wildcards, something like searching for "*s YourInterfaceName" (trying to catch "extend**s** YourInterfaceName" and "implement**s** YourInterfaceName") but is too tricky.

JuanZe
From what I can tell this is correct. Surprising. So the correct answer is no answer I guess..
Marcus
+1  A: 

You can do it with nWire for Java. However, nWire requires Eclipse 3.3 and above. I highly recommend upgrading.

zvikico