Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - how to simultaneously switch working set for project explorer, call hierarchy, and search?

Whenever I switch working sets in the project explorer, the working set does not switch for the search and call hierarchy views, so I end up with search results from the wrong working set if I forget to switch those over manually.

Is there a shortcut for switching working sets in all those tools simultaneously?

Thanks!

like image 489
stupakov Avatar asked May 27 '10 18:05

stupakov


2 Answers

There is a special working set concept in Eclipse called Window working set which is basically a 'centralized' way of managing your working sets.

You can set up your working sets in Window / Working Sets. Most views which have support for working sets have an option to select this special working set (as you can see here). After finishing the setup you can turn on/off your active working set in Window / Working Sets and all views are automatically use the changed values.

Project explorer, call hierarchy and search support this feature.

like image 118
Csaba_H Avatar answered Sep 17 '22 15:09

Csaba_H


To obtain some automation with Working Sets I suggest the following...

First of all a premise. All the views that support Working Sets ask you to select which one they are going to refer to. In the selection dialog, usually, you will find the name of the currently defined Working Sets AND the label Window Working Sets. The latter is, as Csaba_H was saying, some sort of centralized Working Set manager.

Therefore, make sure that every time you need to select a Working Set, your Window Working Set label is selected instead (in the search it's the last input field, press the Choose button...in the Package Explorer, it's the first entry above your WSs).

This is important because when you now change the WS selection within the Window Working Sets (sorry, a lot of WS here), you will automatically change all of them! You will see the Package Explorer change, for example.

As said here already, you can change it through Window -> Working Sets (if the entry is not there, just Window -> Customize Perspective... -> Command Groups Availability tab -> tick on Window Working Set). Not only that, now you can assign a shortcut under Window -> Preferences -> General -> Key -> Select Working Sets (category Window) and use the shortcut to open the selection dialog and change WS from there!

Hope it helps.

like image 34
Andrea Richiardi Avatar answered Sep 17 '22 15:09

Andrea Richiardi