// caseydunham.net

Saturday, May 22, 2010

Eclipse Pulse #001 – Working Sets

As anyone that has been using Eclipse for any period of time can tell you, it doesn’t take long for your Workspace to become a complete mess with a multitude of related or unrelated projects when at any particular time, you only care about one or two specific projects.  I have been using Eclipse for years and one of the biggest issues I have with it is the way that it lumps everything together into Workspaces. An example of this type of Workspace dis-organization can be seen in the screen shot of my experimental workspace below:

Yes, you could always create a new workspace but this is isn’t so simple when you have a few plugins installed, specific project build and run configurations, (and don’t even get me started with custom editor settings…) this can quickly become a mess. You can export some of the settings and than reimport them, but overall I tried working this way for a time and quickly gave it up; it was just too much upkeep. After spending some time seeing how other developers use Eclipse where I work (some use Netbeans and others use IntelliJ) I realized that many developers, even those that have been using Eclipse for a while, don’t know about Eclipse Working Sets. By creating Working Sets and setting the Top Level Element, you can group your projects any way you want since Working Sets have no clue about project dependencies at all.

To create a working set, click on the View Menu button (the down arrow in the upper right corner right next to the minimize button) and select the “Select Working Set” menu option:

This will bring up the Select Working Set dialog from where you need to click the New button

which will bring you to the New Working Set dialog window where you would select the type of projects that the Working Set will contain. Now you can define the Working Sets that you will want to use and the Projects that should be associated with it. I suggest to create as many Working Sets that make sense for the projects that you have. There is no limit to the number of projects that can belong to a particular Working Set and a project can even belong to more than one. A Working Set is just an organizational tool for displaying Projects in Eclipse. I am going to just create  a single Working Set for the testing projects I have in my Workspace:

Now that we have a Working Set defined, we can use it to filter our Projects in any of the Views by going back to the Select Working Sets dialog and selecting a Working Set:

We can also filter the Views to show the Working Sets along with Projects by setting the Top Level Elements under the View menu to Working Sets and not Projects. This is my preferred way of doing it as it shows all of the Working Sets with the Projects beneath them. Any Projects that are not in a user defined Working Set automatically get placed into an “Other Projects” Working Set that Eclipse creates.

At this point the ordering of the Working Sets can be adjusted just by dragging and dropping it to the desired place in the tree or bulk actions on your Projects such as Refreshing an entire Working Set or limiting searches to a particular Working Set can be performed.

While Working Sets provide a bit of help in controlling the Workspace clutter, it’s not as ideal as being able to work with a single Project grouping like Visual Studio’s Solution files or IntelliJ’s project files. This is one area where I find Eclipse very lacking compared to other Java IDE’s.

posted by Casey at 9:16 pm  

Powered by WordPress