How to find which subclasses of given class implement a particular interface in Eclipse?

Viewed 59

I need to browse, in large project, subclasses of given class A implementing a particular interface B.

Is there in Eclipse any way to filter Type Hierarchy of subclasses of A to only those who implement interface B, or to filter hierarchy of classes implementing interface B to subclasses of class A?

1 Answers

You can use the java search in two steps:

Assuming subclasses C1 and C3 of A implement B, but C2 does not:

In the first step, select class A and search for all subclasses of A using the java search (Search->Java...) with option implementors:

enter image description here

Then the search view pops up and we see all subclasses of A:

enter image description here

Select them and hit "Search->Java..." again. Now we can search within this selection for implementors of B.

enter image description here

This gives us subclasses of A that implement B:

enter image description here

Related