How to show all parents and subclasses of a class

2019-01-21 08:49发布

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.

13条回答
老娘就宠你
2楼-- · 2019-01-21 08:55

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

查看更多
ら.Afraid
3楼-- · 2019-01-21 08:56

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.

查看更多
狗以群分
4楼-- · 2019-01-21 08:56

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.)

查看更多
淡お忘
5楼-- · 2019-01-21 08:57

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

查看更多
劳资没心,怎么记你
6楼-- · 2019-01-21 09:01

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

查看更多
萌系小妹纸
7楼-- · 2019-01-21 09:02

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
查看更多
登录 后发表回答