简体   繁体   English

如何按名称查找Eclipse项目和文件夹?

[英]How to find Eclipse projects & folders by name?

Is there a way to search for folders/projects by name in the Eclipse workspace? 有没有办法在Eclipse工作区中按名称搜索文件夹/项目?

The results would best be returned in a view where I can do bulk operations (like closing, opening, assign working set). 结果最好在我可以进行批量操作的视图中返回(如关闭,打开,分配工作集)。 It's just to fiddly to manually click through the list of hundreds of projects. 只需手动点击数百个项目列表即可。


This seemingly trivial task is causing grief to me, which I find embarrassing after all my Eclipse years. 这个看似微不足道的任务给我带来了悲痛,在我所有的蚀刻年代之后,我感到很尴尬。

I have tried: 我试过了:

  1. Search dialogs (Ctrl+H) - among the multitude of options, I don't find anything that would actually select folders or projects (only files) 搜索对话框(Ctrl + H) - 在众多选项中,我找不到任何实际选择文件夹或项目(仅文件)的内容
    • Open Resources(Ctrl+R), looks handier than the dialogs, but again: only file search. 打开资源(Ctrl + R),看起来比对话框更方便,但同样:只有文件搜索。 BTW, why isn't that called "Open File"? 顺便说一句,为什么不称之为“开放档案”? resource can normally be a folder too, right? 资源通常也可以是一个文件夹,对吧?
    • use filtering in the package/project explorer.. But that only supports filtering things out - no way to keep only things matching a pattern 在包/项目浏览器中使用过滤..但是这只支持过滤掉东西 - 没有办法只保留与模式匹配的东西
    • can Working Sets be set up in a dynamic way? 可以动态设置工作集吗? (given search criteria, rather than fixed assignment in a fiddly dialog). (给定搜索条件,而不是在一个繁琐的对话框中固定分配)。 EDIT: this is the winning option, see below. 编辑:这是获胜选项,见下文。

Did I miss something? 我错过了什么? Maybe a 3rd party plugin that gives sane searching for anything? 也许第三方插件可以提供理智的搜索功能? Would (Eclipse/GroovyMonkey) scripting help with this? (Eclipse / GroovyMonkey)脚本会帮忙吗? Mylyn? Mylyn的? Is this too much to ask for, from a such mature environment? 从这样一个成熟的环境中,这要求得太多了吗?

I have kindly asked this on Eclipse forums, and they kindly answered " No " :) As usual, I have more confidence in SO folks, and would be grateful for ideas. 我在Eclipse论坛上好心地问过这个问题,他们很友好地回答“ ”:)像往常一样,我对SO人更有信心,并且会对这些想法感激不尽。


And the -current- winner is Scott's excellent dynamic working sets plugin, which exactly implements the option 4 above! 而目前的赢家是斯科特出色的动态工作集插件,它完全实现了上面的选项4!

First, I'll answer the "dynamic working set" question: 首先,我将回答“动态工作集”问题:

I've written a dynamic working set plugin. 我写了一个动态的工作集插件。 It allows you to group projects by project nature, regular expressions for names, and (as an extension to it) maven group and project name. 它允许您按项目性质,名称的正则表达式以及(作为其扩展)maven组和项目名称对项目进行分组。

Check it out at http://code.google.com/p/javadude/wiki/DynamicWorkingSets 请访问http://code.google.com/p/javadude/wiki/DynamicWorkingSets查看

That may give you everything you need for now... 这可能会为您提供现在所需的一切......

Otherwise, I don't think there is anything like what you're looking for, unless someone writes a plugin for it (which would be easy to do, once used to writing eclipse plugins) 否则,我认为除非有人为它编写插件(这很容易做,曾经用于编写eclipse插件),我认为没有任何你想要的东西。

A couple plugins to check out for this: 一对夫妇插件来检查:

I'm using the first one and I'm quite happy with it. 我正在使用第一个,我对它很满意。 It adds a key shortcut (Ctrl+Alt+F) to search within most tables, treeviews, and text displays and it highlights occurences within the component. 它添加了一个快捷键(Ctrl + Alt + F),可在大多数表,树视图和文本显示中进行搜索,并突出显示组件中的出现情况。 Works on editors, package explorer, etc. 适用于编辑,包浏览器等。

I have not use the second plugin but here's what the home page says: 我没有使用第二个插件,但这是主页所说的内容:

A set of eclipse Plugins which allow easier handling of an eclipse workspace with lots of Projects in it. 一组eclipse插件,可以更轻松地处理带有大量项目的eclipse工作区。

Filter Package Explorer Filter Package Explorer

The Filter Package Explorer provides a view called FPackage Explorer which extends the Package Explorer and adds a filter field at the top. Filter Package Explorer提供了一个名为FPackage Explorer的视图,它扩展了Package Explorer并在顶部添加了一个过滤器字段。

Go to Project Plugin 转到Project Plugin

The Go to Project Plugin provides a dialog similar to the Open Type dialog which lists all available projects in the workspace and allows you to filter them. Go to Project插件提供了一个类似于Open Type对话框的对话框,该对话框列出了工作区中的所有可用项目,并允许您过滤它们。 When selecting one here it is automatically highlighted in whatever file displaying view you might have open. 在此处选择一个时,它会在您可能打开的任何文件显示视图中自动突出显示。 If you don't have any open the Package Explorer is opened showing the project. 如果您没有打开,则打开Package Explorer以显示项目。

The third one is new, here's what it's page says: 第三个是新的,这是它的页面所说的:

Eclipse contains popular shortcuts for selecting types and resources (such as Ctrl+Shift+T). Eclipse包含用于选择类型和资源的常用快捷方式(例如Ctrl + Shift + T)。 This plug-in adds a similar shortcut for projects as well. 此插件也为项目添加了类似的快捷方式。 Type a few letters with wildcards and quickly select one or more projects. 使用通配符键入几个字母,然后快速选择一个或多个项目。 Great for navigating, grouping projects into working sets, or other batch operations on projects. 非常适合导航,将项目分组到工作集或项目的其他批处理操作。

If you're wondering how to do it programatically you can also check this other question . 如果您想知道如何以编程方式执行此操作,还可以检查此其他问题

Another option is to use the "filter" option on the package explorer. 另一种选择是使用包浏览器上的“过滤器”选项。 You can specify a few filters (including names) to filter out items. 您可以指定一些过滤器(包括名称)来过滤项目。 That might help a bit, but not a huge amount. 这可能会有所帮助,但不是很大。

Look for it under the little down-pointing triangle button on the package explorer tool bar. 在包浏览器工具栏上的小向下三角形按钮下查找它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM