Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all available methods of a class in Eclipse?

When extending a Java class, it can be very useful to have quick access to the implementation of all available methods, regardless of whether they are explicitly implemented in said class or inherited from one of its parent classes.

The closest tool that I have been able to find within Eclipse for this purpose is the "Type Hierarchy" view with the "Show all inherited members" option enabled. Unfortunately, that option really does show all inherited members, including the ones that have already been overridden in a parent class. This makes it difficult to tell at a glance which method implementation is the one that is relevant, and things become even more complex with the use of default methods in interfaces.

Is there an option, view, plugin or other technique that would allow quick access only to the method implementations that are relevant to a specific class, including any inherited implementations?

like image 622
thkala Avatar asked Oct 20 '14 19:10

thkala


2 Answers

If you are using STS eclipse click on the Show View -> Outline view.

  • This will list all the members of the class private and public. Click on the particular member and this will take you to that particular method definition.

  • The method names can be copied as well

like image 150
VJM Avatar answered Oct 05 '22 12:10

VJM


Typing Ctrl+O twice in editor when a java type is selected pops-up an outline context dialog that displays the members && inherited members including default methods.

If a method is overridden, I think it shows up higher in the list? So you can see which methods are overridden that way by seeing all the classes that implement the method but also which one is going to be executed by the order in the list?

like image 32
dkatzel Avatar answered Oct 05 '22 14:10

dkatzel