Saturday, 23 May 2009

Eclipse Working Sets

Eclipse is a fantastic IDE, especially for developing Java code. However, recently I've been getting a little irritated by its speed. This is probably exacerbated by the fact that the code I'm working on has about 20 Eclipse projects in it's source tree and thousands of source files. Eclipse gives the developer plenty of help - it does code completion, resolves dependencies, performs automatic imports and refactors across projects - all of which come at a cost. I'm not sure how much time i've spend waiting for my workspace to build, but it can be 10% of the day at worst! Even navigation through that many files becomes a productivity issue.

Recently i've found what is probably a fairly obvious feature of Eclipse but if you haven’t found yet it the concept of “Working Sets” should be useful.

Working sets are a way of choosing only those projects and files that are relevant for the task in hand. It's an alternative, more focussed way to view source files and resources that the Project Explorer - that can really get out of hand if you are working with more than, say, 10 projects. At the simplest level, working sets allow you to configure multiple profiles of visible projects that you can select from depending on the task you are performing. For example, if you are only working on the Eclipse projects that deal with order management in your system, you can select the “Order Management” working set and it will show only those Eclipse projects in the Project Explorer.

You can also bring working sets much further - you can select individual packages and files to form part of the working set (you can even create a working set of breakpoints), so you can be very specific about what you want to split out and see in context. All-in-all it is a useful way to make your Eclipse environment significantly easier to navigate.

To manage working sets use the dropdown arrow on the Project Explorer.

Click New... to create a new working set and select the type of set you want. The default Java type is usually fine for Java programming.

Select the various resources that should be part of the set, and give it a name. The resources can be anything - files, packages or projects.

Finally, use the dropdown menu on the Project Explorer to change active sets.

See the video tutorials here for a walkthrough

1 comment:

  1. Although Eclipse wouldn't benefit me, I'm sure my friends who are currently computer students could use this to develop codes. Thanks for the idea!