Java 如何在 IntelliJ IDEA 中显示一个类的所有父类和子类?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3990781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to show all parents and subclasses of a class in IntelliJ IDEA?
提问by Glide
When I'm editing a Java class in Eclipse, when my cursor is over a class variable, I can do Ctrl+Tto have a popup that shows all its parents and subclasses. What is the equivalent in IntelliJ?
当我在 Eclipse 中编辑 Java 类时,当我的光标位于类变量上时,我可以执行Ctrl+T以显示其所有父类和子类的弹出窗口。IntelliJ 中的等价物是什么?
Example:
例子:
Use|r user = new User();
The pipe is my cursor.
管道是我的光标。
采纳答案by CrazyCoder
Navigate | Type HierarchyCtrl+Hwill show similar information, however in the Panel. You can Floatand Unpinthe Panel so that it appears on the fixed display position only when you use the keyboard shortcut.
导航 | Type HierarchyCtrl+H将显示类似的信息,但在面板中。您可以浮动和取消固定面板,使其仅在您使用键盘快捷键时出现在固定显示位置。
回答by Daniel DiPaolo
Not an IntelliJ IDEA user, but this blog postseems to indicate that in version 8.1.1 and beyond Ctrl+Alt+Uwill display the "Quick Class Hierarchy".
不是IntelliJ IDEA的用户,但这个博客帖子似乎表明,在版本8.1.1及以后Ctrl+ Alt+U将显示“快速类层次结构”。
回答by dimitrisli
In terms of behavior the equivalent of Eclipse Ctrl+Tin IntelliJ IDEA is Ctrl+Alt+B
在行为方面,IntelliJ IDEA中 Eclipse Ctrl+的等价物T是Ctrl+ Alt+B
回答by thSoft
In IntelliJ IDEA 12, it's Navigate > Type Hierarchy(Ctrl+Hby default).
在 IntelliJ IDEA 12 中,它是Navigate > Type Hierarchy(默认为Ctrl+ H)。
回答by sorencito
Also try CTRL+SHIFT+Ain case of any doubt. The short cut for short cut information.
也可以尝试CTRL+ SHIFT+A中如有任何疑问。快捷方式信息的快捷方式。
回答by pohl
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.
我不知道以前的版本,但在 IntelliJ 版本 13 中,您可以进入 Keymap 首选项,搜索“Implementations”,并将其绑定到Ctrl+ T。它将非常像 Eclipse 等价物一样工作。
回答by Cody A. Ray
In IntelliJ 13, it's Navigate > Implementationsor CMD+ ALT+ Bby default. Of course, this shortcut can be overridden in your Keymap preferences.
在13的IntelliJ,它的导航>实现或CMD+ ALT+B默认。当然,可以在您的键盘映射首选项中覆盖此快捷方式。
回答by mkobit
For Mac users who come here, this is the shortcut for IntelliJ 14.1.4:
对于来到这里的 Mac 用户,这是 IntelliJ 14.1.4 的快捷方式:
⌃+Hby default.
⌃+H默认。
回答by Stefan Haberl
Intellij does - in contrast to Eclipse - distinguish between type hierachiesand implementation classes. I'm still undecided whether this is a good thing or not (just switched over from Eclipse to Intellij myself)
与 Eclipse 相比,Intellij 确实区分了类型层次结构和实现类。我仍然不确定这是否是一件好事(我自己刚刚从 Eclipse 切换到 Intellij)
On a Mac Intellij 14
在 Mac Intellij 14 上
- Ctrl+ Hwill bring up the type hierarchy showing you sub- and supertypes
- Cmd+ Alt+ Bwill show you all implementing classes and subclasses of the interface/class you're interested in
- Ctrl+H将显示类型层次结构,显示子类型和超类型
- Cmd+ Alt+B将向您展示您感兴趣的接口/类的所有实现类和子类
回答by Zia
For MacUsers, the shortcut is
对于Mac用户,快捷方式是
^(control) + h
^(控制) + h