如何在Eclipse中按名称查找包?

发布于 2024-12-28 06:13:54 字数 316 浏览 4 评论 0原文

在 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.

enter image description here

I am still missing the Ctrl+Shift+T type of functionality.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

给不了的爱 2025-01-04 06:13:54

Ctrl-H

显示 Java 搜索对话框,您可以在其中选择“搜索”作为包,然后在输入框中键入名称。

Ctrl-H

shows the java search dialog, there you could choose "search For" as package, then type name in inputbox.

菩提树下叶撕阳。 2025-01-04 06:13:54

尝试一下

'Navigate' -> 'Go To' -> 'Package...'

从菜单中 ,可能这就是您正在寻找的。
当然,上述序列可以通过键盘作为一系列标准菜单快捷键来执行。如果您喜欢通过特殊的直接快捷方式访问该功能(在我的 eclipse NEON.1 中默认未定义),您可以通过以下方式定义一个

'Preferences' -> 'General' -> 'Keys'

Try

'Navigate' -> 'Go To' -> 'Package...'

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

'Preferences' -> 'General' -> 'Keys'
平安喜乐 2025-01-04 06:13:54

我不认为有一个可以跳到一个包裹,你想打开什么? 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.

时光病人 2025-01-04 06:13:54

单击根包并开始输入您要查找的包的名称。

Click on the root package and start typing the name of the package you are looking for.

长伴 2025-01-04 06:13:54

Ctrl+Shift+T 也适用于包:只需键入包名称,然后输入一个点,它将显示匹配包中的所有类。以点或星开头以便进行前缀匹配。用点结束搜索字符串很重要,否则最后一个单词将用于匹配类名:

com.sun.mail.
.sun.mail.
*un.mail.

显示以 com.sun.mail 开头的包中的所有类(也匹配 com.sun.mail 本身)。结果:从“ACL”到“YoungerTerm”的 147 个类


com.sun.mail.ascii
.sun.mail.ascii
*un.mail.ascii

显示了以 com.sun.mail 开头且类名以“ascii”开头的包中的所有类。结果:1 类(“ASCIIUtility”)


com.sun.mail.ascii.
.sun.mail.ascii.
*un.mail.ascii.

无结果(没有包“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:

com.sun.mail.
.sun.mail.
*un.mail.

shows all classes in packages beginning with com.sun.mail (also matches com.sun.mail itself). Result: 147 classes from "ACL" to "YoungerTerm"


com.sun.mail.ascii
.sun.mail.ascii
*un.mail.ascii

shows all classes in packages beginning with com.sun.mail AND whose class name begins with "ascii". Result: 1 class ("ASCIIUtility")


com.sun.mail.ascii.
.sun.mail.ascii.
*un.mail.ascii.

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文