Is there a way of viewing all methods available in a class?

I'm looking for a way of showing all methods available in a class,
including those that have been inherited from a superclass. I've tried
the file structure popup and the structure view, but I can't find a way
of making them show inherited items. Am I missing something here, or
should I enter a feature request?

The reason that I want to do this is that I want to find the "most
recent" implementation of a method in a certain class, and I don't know
in which classes the method has been overridden. This has happened
several times, but at the moment I was looking at JPanel and trying to
find out where its add() method is defined. I can do this by typing the
following into another class, and then ctrl-clicking on "add":

JPanel j = new JPanel();
j.add(new JComponent(), "");

But that's a bit cumbersome when IDEA could just give me a popup similar
to the ctrl-f12 file structure popup.

0
6 comments

Maybe the Method Hierarchy pane (View|Method Hierarchy) gives you the
information you want about add().

N.


Jonas Kvarnstr?m wrote:

I'm looking for a way of showing all methods available in a class,
including those that have been inherited from a superclass. I've
tried the file structure popup and the structure view, but I can't
find a way of making them show inherited items. Am I missing
something here, or should I enter a feature request?

>

The reason that I want to do this is that I want to find the "most
recent" implementation of a method in a certain class, and I don't
know in which classes the method has been overridden. This has
happened several times, but at the moment I was looking at JPanel and
trying to find out where its add() method is defined. I can do this
by typing the following into another class, and then ctrl-clicking on
"add":

>

JPanel j = new JPanel();
j.add(new JComponent(), "");

>

But that's a bit cumbersome when IDEA could just give me a popup
similar to the ctrl-f12 file structure popup.



0

Nathan Brown wrote:

Maybe the Method Hierarchy pane (View|Method Hierarchy) gives you the
information you want about add().


I think I can only use that pane if I've already found one
implementation of add(). If I don't know exactly where it is I might
have to traverse half a dozen classes until I do find an implementation
for which I can view the hierarchy (and then I've found the one I wanted
anyway, as long as I search from the bottom of the hierarchy).

0

Yes I think you're right :/

Jonas Kvarnstr?m wrote:

Nathan Brown wrote:

>> Maybe the Method Hierarchy pane (View|Method Hierarchy) gives you the
>> information you want about add().
>

I think I can only use that pane if I've already found one
implementation of add(). If I don't know exactly where it is I might
have to traverse half a dozen classes until I do find an
implementation for which I can view the hierarchy (and then I've
found the one I wanted anyway, as long as I search from the bottom of
the hierarchy).



0

this is clearly an area where IDEA can (and should) learn from Eclipse, which has a view that shows you the superclasses along with the members provided by them. I also consider this a significant shortcoming.

Of course, the ultimate would be what I rememember from Smalltalk environments of old: you could switch the display of the "members" view to show inherited members as well - and you could even show overwritten methods along with callable inherited versions, like in:

public void doSomething()
super: public void doSomething()

0

"Jonas Kvarnstr?m" <jonkv@ida.liu.se> wrote in message
news:3DF48987.4080100@ida.liu.se...

I'm looking for a way of showing all methods available in a class,
including those that have been inherited from a superclass. I've tried
the file structure popup and the structure view, but I can't find a way
of making them show inherited items. Am I missing something here, or
should I enter a feature request?

>


I think this feature request is asking for what you want:

http://www.intellij.net/tracker/idea/viewSCR?publicId=2531


0

Chris Bartley wrote:

I think this feature request is asking for what you want:

http://www.intellij.net/tracker/idea/viewSCR?publicId=2531


Thank you! I've added a couple of votes to this item.

0

Please sign in to leave a comment.