Java Eclipse 键盘快捷键列出项目中的所有类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20224249/
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
Eclipse Keyboard Shortcut To List All Classes in Project
提问by Constantin
Eclipse has this awesome thing called a Quick Outline CTRL+O. I want something similar but with classes, as I am entering a new project with tons of classes and no clue which source file they come from.
Eclipse 有一个很棒的东西叫做 Quick Outline CTRL+ O。我想要类似但有类的东西,因为我正在进入一个包含大量类的新项目,但不知道它们来自哪个源文件。
Example: Press CTRL+Shift+Oand all classes are listed, you start typing it modifies the list, you press enter, it opens that source file.
示例:按CTRL+ Shift+O并列出所有类,您开始键入它会修改列表,按 Enter,它会打开该源文件。
Does this functionality exist in Eclipse? I looked through the Keys
menu, couldn't find anything, probably not using the right name for it.
Eclipse 中是否存在此功能?我浏览了Keys
菜单,找不到任何东西,可能没有使用正确的名称。
采纳答案by harsh
Ctrl+Shift+T: All Types (Classes
) in open projects in workspace
Ctrl+ Shift+ T:工作区Classes
中打开的项目中的所有类型 ( )
Ctrl+Shift+R: All Files (java, xml, properties) in open projects in workspace
Ctrl+ Shift+ R:工作区中打开的项目中的所有文件(java、xml、属性)
First one in useful in finding classes ABC
, XYZ
, SABC
:
第一个用于查找类ABC
, XYZ
, SABC
:
public class ABC {
class XYZ { }
static class SABC { }
}
回答by Kevin Bowersox
Try using CTRL+SHIFT+Rwhich displays a list of all classes/files which can be filtered. It saves tons of time.
尝试使用CTRL+ SHIFT+ R,显示所有的类/文件,这可以被过滤列表。它节省了大量的时间。
This shortcut is known as open resource.
此快捷方式称为打开资源。
If you need to search for a class whose name may not match the filename, such as an inner class you can use file search in combination with class [classname]
.
如果您需要搜索名称可能与文件名不匹配的类,例如内部类,您可以将文件搜索与class [classname]
.
File Search
文件搜索
CTRL+H, then click file search and enter class [yourclasnamehere]
.
CTRL+ H,然后单击文件搜索并输入class [yourclasnamehere]
.
File search is very useful, it will search the contents of every file for a supplied token. I found it so useful I gave the shortcut its own mapping.
文件搜索非常有用,它会在每个文件的内容中搜索提供的令牌。我发现它非常有用,我为快捷方式提供了自己的映射。
回答by Adarsh
Ctrl+Shift+Rto search for class names using wildcards.
Ctrl+ Shift+R使用通配符搜索类名。
This can be used not just for class files but any type of file.
这不仅可以用于类文件,还可以用于任何类型的文件。
回答by sumit
I know its a little late to answer it but would like to add my two cents. apart from all the answers above one can also use 'Type Hierarchy' in eclipse to list down all the classes alphabetically in a specific project of workspace.
我知道回答它有点晚了,但我想加上我的两分钱。除了上面的所有答案之外,还可以在 eclipse 中使用“类型层次结构”来按字母顺序列出工作区特定项目中的所有类。
In left pane select project whose classes you wish to see and press F4
Alternatively, In left pane select project whose classes you wish to see, right click and click on "Open Type Hierarchy"
在左窗格中选择您希望查看其类的项目,然后按 F4
或者,在左窗格中选择您希望查看其类的项目,右键单击并单击“打开类型层次结构”
select projectand open Type Hierarchyor Simply press Shortcut F4
选择项目并打开类型层次结构或只需按快捷键F4
It will look like below
它看起来像下面
回答by Younes LAB
Use Ctrl + Shift + H
keys to search for classes.
使用Ctrl + Shift + H
键来搜索类。