在 Eclipse 中,在包资源管理器中,我可以按名称查找文件吗?

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

In Eclipse, in the package explorer, can I find files by name?

eclipse

提问by Aaron Fi

You know how in Eclipse's Preferences window (menu bar: Window --> Preferences), you have a hierarchy to browse, but you also have a text search field. And as you type into that search field, the hierarchy is filtered to show only entries matching what you typed?

您知道在 Eclipse 的 Preferences 窗口(菜单栏:Window --> Preferences)中,您有一个层次结构可供浏览,但您还有一个文本搜索字段。当您在该搜索字段中键入内容时,层次结构将被过滤以仅显示与您键入的内容匹配的条目?

I would love to see the same feature in the Package Explorer tab. I have 100s of files in my Package Explorer hierarchy. Oftentimes I just want to type in a partial name, and see only those matching entries.

我很想在 Package Explorer 选项卡中看到相同的功能。我的包资源管理器层次结构中有 100 个文件。通常我只想输入部分名称,然后只查看那些匹配的条目。

Does this feature exist? Something related, that would accomplish the same goal? (search, not browse)?

有这个功能吗?一些相关的东西,会实现同样的目标吗?(搜索,而不是浏览)?

Thanks

谢谢

回答by frm

You can do the opposite of what you want to do. Click on the white arrow on the right of the package explorer, select Filters...and type an expression with wildcards. Eclipse will notshow the resources matching this pattern.

你可以做与你想做的相反的事情。单击包浏览器右侧的白色箭头,选择Filters...并键入带有通配符的表达式。Eclipse不会显示与此模式匹配的资源。

You can search for types in your workspace with the shortcut Ctrl+Shift+Tor for files in general with Ctrl+Shift+R. You can specify a pattern in the same way you can do for filters.

您可以用快捷键您的工作空间搜索类型Ctrl+ Shift+T或在一般的文件与Ctrl+ Shift+ R。您可以使用与过滤器相同的方式指定模式。

回答by pavanlimo

Ctrl+Shift+R

Ctrl+ Shift+R

Type only partial name in the text field to find your file.

在文本字段中仅键入部分名称以查找您的文件。

回答by Mitech

There is a small button with "left right arrows" (link with editor) near Package Explorer. Click that and you can use Ctrl+Shift+R with it. It will show you the current open file in Package Explorer.

包资源管理器附近有一个带有“左右箭头”(与编辑器链接)的小按钮。单击它,您可以使用 Ctrl+Shift+R。它将显示包资源管理器中当前打开的文件。

Link with editor option in eclipse

与 Eclipse 中的编辑器选项链接

回答by froadie

I'm not quite sure if this is what you're looking for... but try ctrl + shift + r

我不太确定这是否是您要查找的内容...但请尝试 ctrl + shift + r

回答by Jason Xiong

As others have mentioned, ctrl + shift + r works nicely if you have thousands of files in your project.

正如其他人所提到的,如果您的项目中有数千个文件,则 ctrl + shift + r 可以很好地工作。

Also, I would like to add the following: you can add additional folder into the existing project by the following sequence: File, new, folder. In the pop-up window, select Advanced, select Link to alternate location (Linked Folder), Browse...

另外,我想添加以下内容:您可以按以下顺序将其他文件夹添加到现有项目中:文件、新建、文件夹。在弹出窗口中,选择高级,选择链接到备用位置(链接文件夹),浏览...

To add new file, just do: File, new, source file

要添加新文件,只需执行: File, new, source file

After you added the additional file or folder, then at the project root, hit F5 to refresh the project so that the new file and the new folder will be brought into the project.

添加附加文件或文件夹后,在项目根目录下,按 F5 刷新项目,以便将新文件和新文件夹带入项目。

And then you can use ctrl + shift + r to also find the newly added file of the newly added folders.

然后你可以使用 ctrl + shift + r 也可以找到新添加文件夹的新添加文件。

回答by Harsh Phoujdar

Simple. Just press Ctrl + H(Windows),

简单的。只需按Ctrl + H(Windows),

this will open up the Advanced Searchwindow.

这将打开高级搜索窗口。

Go to File Searchtab and type in the required parameters:

转到文件搜索选项卡并输入所需的参数:

For example click here

例如点击这里

The above example showcases me trying to search for all occurrences of .xmlfiles within a specific folder

上面的示例展示了我尝试搜索.xml特定文件夹中所有出现的文件