简体   繁体   English

eclipse中的Ctrl Alt H和f4有什么区别

[英]What is the difference between Ctrl Alt H and f4 in eclipse

I'm not able to understand the difference between Ctrl+Alt+H and F4 in eclipse. 我无法理解Eclipse中Ctrl + Alt + H和F4之间的区别。

I see both of them providing the same results. 我看到它们都提供相同的结果。 The only two differences is see is : 看到的唯一两个区别是:

1)While Ctrl+Alt+H loads on the Direct Callers and loads indirect callers only if we navigate through them , F4 loads them all in one go. 1)虽然Ctrl + Alt + H会在直接调用方上加载,并且仅在我们浏览间接调用方时才加载间接调用方,但是F4一次性加载全部。

2)Ctrl+Alt+H is not available on an interface while F4 is. 2)Ctrl + Alt + H在F4上不可用。

Is there any other significant difference between the two and is my understanding correct with reference to the two points mentioned? 两者之间是否还有其他重大区别?我对上述两点的理解是否正确?

CTRL+ALT+H opens the Call Hierarchy F4 opens the Type Hierarchy Ctrl + Alt + H打开呼叫层次结构F4打开类型层次结构

The Call Hierarchy is available for any member of a class, if you select a method name and press CTRL+ALT+H you will see all members in your workspace that call this method (very useful to see what is depending on a method/constructor/field). 调用层次结构可用于类的任何成员,如果您选择方法名称并按CTRL + ALT + H,您将在工作区中看到所有调用此方法的成员(非常有用,以了解取决于方法/构造函数的内容) /领域)。 Try to press CTRL+ALT+H when your cursor is not on a member name or body (ie between method declarations), you will see an error "Operation unavailable on the current selection. Select one or more methods, classes, fields, or initializers". 当光标不在成员名称或主体上(即方法声明之间)时,尝试按CTRL + ALT + H,您将看到错误“当前选择上不存在该操作。选择一个或多个方法,类,字段或初始化程序”。 The call hierarchy is where we see both direct and indirect callers. 呼叫层次结构是我们看到直接和间接呼叫者的地方。

The Type Hierarchy is only available for types, clicking on a type name in your code and pressing F4 will display that type's superclasses all they way up to Object. 类型层次结构仅适用于类型,单击代码中的类型名称,然后按F4键将显示该类型的超类直至对象。 If your cursor is not focused on a type name then pressing F4 will open the type hierarchy for the class in the currently displayed file. 如果光标没有放在类型名称上,则按F4键将在当前显示的文件中打开类的类型层次结构。 The type hierarchy shows neither direct nor indirect callers. 类型层次结构既不显示直接调用者也不显示间接调用者。

F4 opens the Type Hierarchy view and Ctrl + Alt + H opens the Call Hierarchy view. F4打开“ 类型层次”视图,而Ctrl + Alt + H打开“ 呼叫层次”视图。

The Type Hierarchy does not show the Direct Callers rather than the Classes it extends and extending it. 类型层次结构不显示直接调用者,而不显示它扩展和扩展的类。 Thats also the reason why its available on an Interface while the Call hierarchy is not (The Call Hierarchy of a class shows all callers of its constructor, and an interface has no constructor) 这也是为什么其在调用层次结构上不可用的情况下在接口上可用的原因(类的调用层次结构显示其构造函数的所有调用者,而接口没有构造函数)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM