Eclipse IDE。查看类的所有继承方法的列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4457796/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:30:40  来源:igfitidea点击:

Eclipse IDE. See list of all a class's inherited methods

eclipsemethodshierarchy

提问by Justian Meyer

Gonna keep this one short. Is there any way to click on the name of a class in the editor and see a list of all of its methods (inherited and otherwise) in another window?

将保持这个简短。有没有办法在编辑器中单击类的名称并在另一个窗口中查看其所有方法(继承的和其他的)的列表?

This relates to my other question here: https://stackoverflow.com/questions/4457751/drag-and-drop-with-andengine-android, where I'm afraid I am overlooking a useful method.

这与我在这里的另一个问题有关:https: //stackoverflow.com/questions/4457751/drag-and-drop-with-andengine-android,恐怕我忽略了一个有用的方法。

Many thanks in advance for any help.

非常感谢您的帮助。

-Justian M.

-贾斯蒂安·M。

采纳答案by David O'Meara

When you open a class in Eclipse, the left hand gutter for the edit window (the same area that has the breakpoint indicators) has a small up arrow if that method implements or overrides behaviour from an interface or parent class. Is this what you're asking? If you open the Outline view you can also see the up arrow and this may make it easier to see the list of methods.

当您在 Eclipse 中打开一个类时,如果该方法实现或覆盖来自接口或父类的行为,则编辑窗口(具有断点指示符的同一区域)的左侧装订线有一个小的向上箭头。这是你要问的吗?如果您打开 Outline 视图,您还可以看到向上箭头,这样可以更轻松地查看方法列表。

回答by Pakka Techie

You can use ctrl+O in the target class and when you want to see its inherited methods/members you have to again press ctrl+O (two times ctrl+O). This will work for both source files and class files

您可以在目标类中使用 ctrl+O,当您想查看其继承的方法/成员时,您必须再次按 ctrl+O(两次 ctrl+O)。这将适用于源文件和类文件

回答by Sandman

Press F4 to open a 'Type hierarchy view'. Alternatively, right-click in the editor and select the option 'Open type hierarchy' from the context menu. Then, in this view, find a button with a tooltip 'Show all inherited members' (it's the second one in the row with the currently selected class name in it). This will show you all inherited members of the class that is currently selected in the Type hierarchy view.
If you click the right-most button in the same row (the green circle), you will only see public members. Of course, it would be great if there was an option to see only non-private members, however, I haven't found such an option.
Still, the ability to see all the inherited members is probably good enough?

按 F4 打开“类型层次结构视图”。或者,在编辑器中右键单击并从上下文菜单中选择“打开类型层次结构”选项。然后,在此视图中,找到一个带有工具提示“显示所有继承的成员”的按钮(它是包含当前所选类名的行中的第二个)。这将向您显示当前在类型层次结构视图中选择的类的所有继承成员。
如果您单击同一行最右侧的按钮(绿色圆圈),您将只能看到公共成员。当然,如果有一个选项可以只看到非私人成员,那就太好了,但是,我还没有找到这样的选项。
不过,能看到所有继承的成员,大概就够了?

回答by Pavan

Just pressing ctrl+space in the class [outside any method] would show you all the methods that are not overriden but available from the parent class. You can see methods right upto the Object class. Hope that helps.

只需在类中按 ctrl+space [在任何方法之外] 就会向您显示所有未被覆盖但可从父类中使用的方法。您可以看到直到 Object 类的方法。希望有帮助。

回答by kandarp

Please use ctrl+o short cut to get all the methods used in that class.

请使用 ctrl+o 快捷方式获取该类中使用的所有方法。