How to show all parents and subclasses of a class in IntelliJ IDEA?

JavaIntellij Idea

Java Problem Overview


When I'm editing a Java class in Eclipse, when my cursor is over a class variable, I can do Ctrl+T to have a popup that shows all its parents and subclasses. What is the equivalent in IntelliJ?

Example:

Use|r user = new User();

The pipe is my cursor.

Java Solutions


Solution 1 - Java

Navigate | Type Hierarchy Ctrl+H will show similar information, however in the Panel. You can Float and Unpin the Panel so that it appears on the fixed display position only when you use the keyboard shortcut.

Solution 2 - Java

In terms of behavior the equivalent of Eclipse Ctrl+T in IntelliJ IDEA is Ctrl+Alt+B

Solution 3 - Java

Not an IntelliJ IDEA user, but this blog post seems to indicate that in version 8.1.1 and beyond Ctrl+Alt+U will display the "Quick Class Hierarchy".

Solution 4 - Java

Intellij does - in contrast to Eclipse - distinguish between type hierachies and implementation classes. I'm still undecided whether this is a good thing or not (just switched over from Eclipse to Intellij myself)

On a Mac Intellij 14

  • Ctrl + H will bring up the type hierarchy showing you sub- and supertypes
  • Cmd + Alt + B will show you all implementing classes and subclasses of the interface/class you're interested in

Solution 5 - Java

Also try CTRL+SHIFT+A in case of any doubt. The short cut for short cut information.

Solution 6 - Java

In IntelliJ IDEA 12, it's Navigate > Type Hierarchy (Ctrl+H by default).

Solution 7 - Java

For Mac users who come here, this is the shortcut for IntelliJ 14.1.4:

+H by default.

Solution 8 - Java

For Mac Users, the shortcut is

^(control) + h

Solution 9 - Java

In IntelliJ 13, it's Navigate > Implementations or CMD + ALT + B by default. Of course, this shortcut can be overridden in your Keymap preferences.

Solution 10 - Java

I don't know about prior versions, but in IntelliJ version 13 you can go into your Keymap preferences, search for "Implementations", and bind that to Ctrl+T. It will work very much like the Eclipse equivalent.

Solution 11 - Java

With Eclipse, hitting Ctrl+T on a type displays its subtypes and hit again Ctrl+T displays so supertypes. And so for... this is a toggle.
That is really helpful and also very straight.

Unfortunately with IntelliJ, the switch between the supertypes and the subtypes doesn't have any default shortcut. So you will have to click on the icons of the hierarchy windows.
If like me you favor the keyboard shortcuts to the "move cursor and click on mouse" option, I encourage you to set a binding for these two operations. For example Ctrl+Down for subtypes and Ctrl+Up for supertypes.

Where you can change the binding ("Bas" means "Down" and "Haut" means "Up") : biding

Note that these bindings are contextual to the "Other" context (Eclipse does have a similar enough concept).

  1. In this way, enter Ctrl+T on a ArrayList type produces :

Default hierarchy

  1. Enter Ctrl+Down focuses on subtypes :

subtypes focus

  1. And Enter Ctrl+Up focuses on supertypes :

supertypes focus

In this way, I find it better than the default behavior but to be honest even with that shortcut adding, the IntelliJ feature is not as good as Eclipse which the Ctrl+T shortcut also works on methods...

Solution 12 - Java

Whilst Eclipse includes the type hierarchy and class structure (methods, fields etc.) in a single view, IntelliJ splits these up: In addition to the CTRL+H (or ALT+8) "Type Hierarchy" view, the other relevant IntelliJ window is called "Structure" and can be invoked via ALT+7 (Structure Tool Window) or CTRL+F12(Structure popup).

(Not a direct answer to the exact question posted but would expect others from an Eclipse background may arrive here having googled for "intellij type hierarchy", as I did.)

Solution 13 - Java

Ctrl+U - go to base class

Ctrl+Alt+B - got to implementation. Type parts of class name to narrow down the list

Ctrl+H - open type hierarchy tool window

Ctrl+Alt+U - peek class/interface inheritance hierarchy

Solution 14 - Java

One more option to do this:

For Windows user:

Ctrl + Alt + Left mouse click on type, method etc.

You will get this

Solution 15 - Java

There is a hierarchy view as in Eclipse, have a look at the menu View / Tool Windows / Hierarchy or press Alt-8 or F4.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGlideView Question on Stackoverflow
Solution 1 - JavaCrazyCoderView Answer on Stackoverflow
Solution 2 - JavadimitrisliView Answer on Stackoverflow
Solution 3 - JavaDaniel DiPaoloView Answer on Stackoverflow
Solution 4 - JavaStefan HaberlView Answer on Stackoverflow
Solution 5 - JavasorencitoView Answer on Stackoverflow
Solution 6 - JavathSoftView Answer on Stackoverflow
Solution 7 - JavamkobitView Answer on Stackoverflow
Solution 8 - JavaZiaView Answer on Stackoverflow
Solution 9 - JavaCody A. RayView Answer on Stackoverflow
Solution 10 - JavapohlView Answer on Stackoverflow
Solution 11 - JavadavidxxxView Answer on Stackoverflow
Solution 12 - JavaSteve ChambersView Answer on Stackoverflow
Solution 13 - JavaKonstantin SpirinView Answer on Stackoverflow
Solution 14 - JavaTorinoView Answer on Stackoverflow
Solution 15 - JavaherberlinView Answer on Stackoverflow