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

12

55

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?

Saccharase answered 1/7, 2010 at 16:35 Comment(2)
Setting list view instead of tree view in search results might help here.Knighterrant
@PiotrDobrogost and also use SortBy/ParentName will make it have the same ordering of tree view!Auxiliary
D
10

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.

Dealing answered 1/7, 2010 at 16:45 Comment(3)
There's also a small "+" icon at the top right of the window that has the same function. Thanks.Saccharase
@Saccharase For some reason I only have the "-" icon and I can't figure out how to add the "+"Eyespot
@Eyespot that is my case as wellLowry
M
66

In Windows:

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

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.

Mcdougal answered 13/5, 2011 at 15:58 Comment(8)
Lindsay, you have made our day. There are a team of us here using Eclipse for some Oracle products, and until we found this we'd spent probably hours having to expand nodes in a wide variety of selection menus. Thank you ever so much, signed some Madridians. How on earth did you find the shortcut?Pitt
+1 Though on my Windows 7 with Eclipse Indigo, its working even without Shift and Ctrl+Shift buttons. Expanding with * (multiply) and collapse with - (subtract)Gwen
On Linux with Eclipse Kepler jamming on the right arrow does nothing. Adding SHIFT is necessary.Nesselrode
Careful! This can crash Eclipse if there is too much in the tree. It expands all nodes, including nested nested dependencies, etc.Topology
For me "collapse all" was Ctrl+Shift+Numpad / but the real lifesaver here is seeing all shortcuts with Ctrl+Shift+LOverbalance
Tip: when you use multiply to expand all, DON'T select the project root, instead select a subfolder. Reason: if you select the project root, it will try to expand all your projects.Lucullus
Thanks for the tips. Update for Eclipse Mars on Windows 10 (using inside "Search View"): Numpad * - expands all in the selected folder, Numpad + - expands ONE level below the selected folder, Numpad - - collapses previous expanded folder (or if ALL was expanded then next underlying level along WITH the expanded folder down below) in the selected folder. Notice that all works even without Shift.Drobman
Perfect answer for me. I will not waste my time anymore by clicking, clicking, clicking...Recently
J
38

On Mac: Select a folder and press Option+ARROW_RIGHT to expand all subfolders in the Eclipse file explorer. Press Option+ARROW_LEFT to collapse all subfolders.

On some Mac keyboards the Option key is also labeled Alt

Jules answered 7/12, 2010 at 13:31 Comment(3)
Yeah its too bad Eclipse lists the hot key as Cmd-Shift-NumPad* yet that doesnt work in any context (Search, Outline, Project Explorer) yet alt+ARROW_RIGHT does. Ive needed this shortcut all my life.Frigidaire
Sorry to be obtuse, by my mac doesn't have an "Alt" key. I figure you might mean "Command", but Command-Right-Arrow causes Eclipse to beach-ball on me. (I'm using Eclipse Luna on Mavericks.)Sussna
The reason is beach ball is likely it tried to expand the tree for your Java resources, which is every jar and every class inside that jar.Disconsolate
C
23

Eclipse on Linux:

SHIFT + RIGHT arrow

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

SHIFT + LEFT arrow

Collapses all folders below the selected folder.

Eclipse on Windows:

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

Cassimere answered 7/2, 2012 at 0:24 Comment(1)
Thanks! Shift+Right worked. Even the Ctrl+Shift+L list showed an incorrect shortcut. It said Ctrl+Shift+NumPadAsterix would expand all but it didn't.Hydrops
C
13

Mars.1 Release (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.)


Collapse All Folders

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


Expand/Collapse Single Folders

Shift + Right Arrow
Shift + Left Arrow

Canaliculus answered 22/12, 2015 at 22:5 Comment(0)
D
10

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.

Dealing answered 1/7, 2010 at 16:45 Comment(3)
There's also a small "+" icon at the top right of the window that has the same function. Thanks.Saccharase
@Saccharase For some reason I only have the "-" icon and I can't figure out how to add the "+"Eyespot
@Eyespot that is my case as wellLowry
R
6

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

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!

Rubberize answered 1/7, 2010 at 16:41 Comment(1)
It appears that CTRL-SHIFT-R (or CMD-SHIFT-R on Mac OS X) searches filenames only. I'm trying to search within files like grep. The keyboard shortcut you mentioned is documented as Expand All, not Collapse All, and it doesn't work on Mac OS X. And as I've learned how to customize keyboard shortcuts since asking this question, I tried creating several different shortcuts for Expand All and none of them seem to work.Saccharase
I
6

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

in Project/Package Explorer:

Expand all : Shift + Numpad *

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

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.

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 + T: open type ( for Java files only)

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.

Ilex answered 18/4, 2013 at 5:50 Comment(0)
A
4

Shift + Right arrow, repeatedly.

Adamantine answered 26/4, 2011 at 17:58 Comment(0)
U
3

Following works for Eclipse 4.4 on Linux:

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

Pressing - (or shift+) collapses all content.

Urien answered 12/3, 2015 at 13:37 Comment(0)
A
2

shift + * Expand ALl

Shift _ - Collapse All

that's it.

Angelita answered 17/4, 2013 at 6:16 Comment(0)
I
0

Disable Focus on Active Task option - shown below.

Eclipse package explorer view

Incursion answered 19/7, 2018 at 7:19 Comment(0)
A
0

buttons to expand all
Shift and (+)

buttons to minimize all
Shift and (-)

Alboran answered 20/2, 2020 at 13:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.