有没有办法在 Eclipse 项目视图和搜索结果中展开所有文件夹?

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

Is there way to expand all folders in Eclipse project view and search results?

eclipsesearchtreeviewdirectoryexpand

提问by meva

I'm spending a lot of time manually expanding deeply-nested folders in tree views like the Project Explorer and the File Search result tree. Is there a keyboard shortcut or menu command to expand all folders?

我花了很多时间在树视图(如项目资源管理器和文件搜索结果树)中手动扩展深层嵌套的文件夹。是否有用于展开所有文件夹的键盘快捷键或菜单命令?

采纳答案by dweeves

In "File Seach Result", right click on the top level folder, there is an "expand all" menu entry.

在“文件搜索结果”中,右键单击顶级文件夹,有一个“全部展开”菜单项。

In the project view, I didn't find the feature.

在项目视图中,我没有找到该功能。

回答by Lindsay

In Windows:

在 Windows 中:

Expand all all in project explorer is Shift+Numpad *(multiplty), as mentioned before. Collapse all in project explorer is Ctrl+Shift+Numpad -(subtract).

如前所述,在项目资源管理器中展开全部为Shift+ Numpad *(multiplty)。关闭全部在项目资源管理器Ctrl+ Shift+ Numpad -(减)。

Alternatively, you can just jam on the right arrow to expand to the bottom of a selected tree, or jam on the left arrow to collapse back up to the top.

或者,您可以只按向右箭头扩展到所选树的底部,或按向左箭头折叠回顶部。

If you want to see all the shortcuts available for the particular context you are in, type Ctrl+Shift+L.

如果要查看可用于您所在特定上下文的所有快捷方式,请键入Ctrl+ Shift+ L

回答by Jeremias Erbs

On Mac: Select a folder and press Alt+ARROW_RIGHT. That should expand all subfolders in the file explorer of eclipse.

在 Mac 上:选择一个文件夹并按Alt+ ARROW_RIGHT。这应该展开 eclipse 文件资源管理器中的所有子文件夹。

回答by phshah

Eclipse on Linux:

Linux 上的 Eclipse:

SHIFT + RIGHT arrow

SHIFT + 向右箭头

Expand all folders below the selected folder. If you do it multiple times, next set of folders expand.

展开所选文件夹下的所有文件夹。如果您多次执行此操作,则会展开下一组文件夹。

SHIFT + LEFT arrow

SHIFT + 左箭头

Collapses all folders below the selected folder.

折叠所选文件夹下的所有文件夹。

Eclipse on Windows:

Windows 上的 Eclipse:

Right arrow -->> Expand
Left arrow -->> Collapse

右箭头 -->> 展开
左箭头 -->> 折叠

回答by binarysubstrate

Mars.1 Release (4.5.1), Linux (RHEL 6.7)

Mars.1 版本 (4.5.1),Linux (RHEL 6.7)

Expand Folders

展开文件夹

Tap *once for each level that all folders under the selected folder should be expanded. For example, tapping * three times will expand all folders out to three levels.

*每个级别点击一次,所选文件夹下的所有文件夹都应展开。例如,点击 * 三次会将所有文件夹扩展到三个级别。

(CTRL SHIFT Numpad * doesn't work for me as it should with this particular build/machine.)

(CTRL SHIFT Numpad * 对我不起作用,因为它应该适用于这个特定的构建/机器。)


Collapse All Folders


折叠所有文件夹

Tap Numpad /once to collapse all folders under the selected folder.

点击Numpad /一次可折叠所选文件夹下的所有文件夹。


Expand/Collapse Single Folders


展开/折叠单个文件夹

Shift+ Right Arrow
Shift+ Left Arrow

Shift+ Right Arrow
Shift+Left Arrow

回答by Vincent Jia

In Windows: ( I'm using STSv2.8 based on Eclipse 3.7, maybe a little different...)

在 Windows 中:(我使用的是基于 Eclipse 3.7 的STSv2.8,也许有点不同...)

in Project/Package Explorer:

在项目/包资源管理器中:

Expand all : Shift+ Numpad *

展开全部:Shift+Numpad *

Collpse all: Ctrl+ Shift+ Numberpad_Divide, or just click the small "-" iconat the top right of current view.

全部折叠:Ctrl+ Shift+ Numberpad_Divide,或者只需单击当前视图右上角的小“-”图标

But from wat I can see, Expand All action always make the Eclipse/STS not responding (e.x, we may set class files - compiled or in JARs - visible in current view, which cause too many file to be expanded), so maybe it's better to select specified package first.

但是从 wat 我可以看到,Expand All 操作总是使 Eclipse/STS 没有响应(例如,我们可能设置类文件 - 已编译或在 JAR 中 - 在当前视图中可见,这会导致要扩展的文件太多),所以也许是最好先选择指定的包。

Also these shortcuts very helpful to locate files:

这些快捷方式也非常有助于定位文件:

Ctrl+ Shift+ R: open resource ( all file types, java, jsp, jspf, properties ...), it's my most frequent use and favorite shortcut;

Ctrl+ Shift+ R:打开资源(所有文件类型,java,jsp,jspf,属性...),这是我最常用和最喜欢的快捷方式;

Ctrl+ Shift+ T: open type ( for Java files only)

Ctrl+ Shift+ T:打开类型(仅适用于 Java 文件)

In Search result tab, there are Expand All(+ sign with border)and Collapse All(- sign with border)icons at the top right of the tab.

在“搜索结果”选项卡中,选项卡右上角有“全部展开(+ 带边框符号)”“全部折叠”(- 带边框符号)图标。

回答by zengr

If you want to simply search a file anywhere: CTRL+ SHIFT+ R(Faster workspace navigation)

如果你想简单地搜索文件的任何地方:CTRL+ SHIFT+ R(更快的工作空间导航)

Collapse All: Shift+ NUM-KEYPAD-MULTIPLY (*)-->Use with caution, if you do it on a large project, ALL the files will be expanded! Just managed to crash my Eclipse!

全部折叠:Shift+ NUM-KEYPAD-MULTIPLY (*)-->谨慎使用,如果你在一个大项目上这样做,所有的文件都会被展开!刚刚设法使我的 Eclipse 崩溃!

回答by Ed G

Shift + Right arrow, repeatedly.

Shift + 右箭头,重复。

回答by mjtecka

Following works for Eclipse 4.4 on Linux:

以下适用于 Linux 上的 Eclipse 4.4:

Pressing *(or shift+) repeatedly while a folder is selected expands it's contents.

选择文件夹时反复按*(或shift+ ) 可展开其内容。

Pressing -(or shift+) collapses all content.

-(或shift+ )折叠所有内容。

回答by TDS

shift + * Expand ALl

shift + * 展开所有

Shift _ - Collapse All

Shift _ - 全部折叠

that's it.

就是这样。