如何在Eclipse中按名称查找包?
在 Eclipse 中导航到 Java 包的最快方法是什么?我正在寻找类似于 Ctrl+Shift+T 为类所做的事情。
编辑:Ctrl+H 有效,但用途有限。其一,没有简单的方法可以导航到搜索结果,因为它不可点击。
我仍然缺少 Ctrl+Shift +T 类型的功能。
What is the fastest way to navigate to Java package in Eclipse? I am looking for something similar to what Ctrl+Shift+T does for classes.
Edit: Ctrl+H works, but it is of limited use. For one, there is no easy way to navigate to search result, because it is not clickable.
I am still missing the Ctrl+Shift+T type of functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Ctrl-H
显示 Java 搜索对话框,您可以在其中选择“搜索”作为包,然后在输入框中键入名称。
Ctrl-H
shows the java search dialog, there you could choose "search For" as package, then type name in inputbox.
尝试一下
从菜单中 ,可能这就是您正在寻找的。
当然,上述序列可以通过键盘作为一系列标准菜单快捷键来执行。如果您喜欢通过特殊的直接快捷方式访问该功能(在我的 eclipse NEON.1 中默认未定义),您可以通过以下方式定义一个
Try
from the menu, probably this is what you are looking for.
Of course the above sequence can be performed from the keyboard as a series of standard menu shortcuts. If you prefer to access that functionality via a special direct shortcut (which is not defined by default in my eclipse NEON.1), you can define one via
我不认为有一个可以跳到一个包裹,你想打开什么? Ctrl+H 打开搜索对话框,您可以使用它来搜索包。
I don't think there's one to jump to a package, what would you want to open? Ctrl+H opens the search dialog which you can use to search for packages.
单击根包并开始输入您要查找的包的名称。
Click on the root package and start typing the name of the package you are looking for.
Ctrl+Shift+T 也适用于包:只需键入包名称,然后输入一个点,它将显示匹配包中的所有类。以点或星开头以便进行前缀匹配。用点结束搜索字符串很重要,否则最后一个单词将用于匹配类名:
显示以 com.sun.mail 开头的包中的所有类(也匹配 com.sun.mail 本身)。结果:从“ACL”到“YoungerTerm”的 147 个类
显示了以 com.sun.mail 开头且类名以“ascii”开头的包中的所有类。结果:1 类(“ASCIIUtility”)
无结果(没有包“com.sun.mail.ascii”)
如果您在
“包资源管理器”视图,只需选择任何匹配项,包资源管理器就会扩展到该包。您可以使用 ← 访问根包(首先选择包资源管理器,例如使用 Ctrl+F7)。
Ctrl+Shift+T works for packages too: Just type the package name and then a dot and it will show all classes in matching packages. Start with a dot or star in order to do prefix matching. It's important to end the search string with a dot, otherwise the last word will be used to match against class names:
shows all classes in packages beginning with com.sun.mail (also matches com.sun.mail itself). Result: 147 classes from "ACL" to "YoungerTerm"
shows all classes in packages beginning with com.sun.mail AND whose class name begins with "ascii". Result: 1 class ("ASCIIUtility")
No results (there is no package "com.sun.mail.ascii")
If you have "Link with Editor" set in the
"Package Explorer" view, just select any of the matches and the package explorer will expand to the package. You can get to the root package with ← (select the package explorer first, e.g. using Ctrl+F7).