NetBeans has a helpful (to me anyway!) feature under the "Views" menu, called "Synchronize Editor with Views". As the name suggests, toggling this on will cause the navigator view to jump straight to a file when it's opened in the editor.
I generally prefer this to the normal "Ctrl+Shift+1" shortcut for manually jumping to a file. However, the downside is that after editing several files, your navigator tree is a mess of multiple open directories.
Eclipse has similar functionality, but it also has a "collapse all" button at the top of its navigator view... restoring things with a single click having to scroll around. Does NetBeans have any similar mechanism for collapsing open directories? Maybe a poorly-documented keyboard shortcut buried in there or something?
34 Answers
Collapse Fold Ctrl+Minus Expand Fold Ctrl+Plus Collapse All Folds Ctrl+Shift+Minus Expand All Folds Ctrl+Shift+Plus 4Unfortunately, after further digging on the NetBeans discussion forums and mailing lists, it seems that this functionality simply doesn't exist. That's a shame... hopefully they'll add it in the future.
6A dirty solution is to close the project and reopen it. It will start collapsed.
2Close the navigator (press the x). Then go to Window->Navigating->Navigator or press Ctrl+7. It should open the navigator with all collapsed.
1