Gold Apple Software Web Development by Geoff Appleby

Organizing Eclipse Projects with Working Sets

My first use of Eclipse was in university, where to keep organized I would separate each course into its own workspace.  This was bred out of the fact the each course could typically have several labs and a term project, each with starter code from the professor in its own pre-made Eclipse project.  It was simply easier to have separate workspaces, each with their own "Lab 1" project than to sort through every project in a single workspace.  This presented its own challenges, however, as each workspace would have to be configured correctly and on occasion it would be necessary to review code between courses

Eclipse has remained my prefered IDE for PHP development.  A similar organizational issue has arisen as each client has their own project(s), and particularly with Drupal many contributed modules are involved as well.  It's simply not feasible to have separate workspaces for each client, especially when they utilize so much common code.  This is also compounded if you are working with multiple versions of Drupal or contributed modules through CVS (or learning about Git).

Some time ago I ran across a short article on an Eclipse feature called Working Sets that greatly helps organize a large collection of projects in one workspace.  They are very simple to create and configure, and allow you to limit the display of your workspace to a subset of all the projects you have available.  I utilize this to have quick displays of Drupal and contributed modules for different major releases, or to view only those projects relevant to a specific client.  Projects can be in multiple working sets as well, so multiple client projects can all include the same contributed module projects, making working with them and contributing back much easier than if they were all separated between different workspaces.

Working Sets are also utilized in other areas of Eclipse; one of note is in the search dialog where you can restrict your search to any working sets you select.  This provides a good option between searching your entire workspace or a single project.

Create a new Working Set

Working sets are accessed through the additional options menu in the Project Explorer or Navigator views.  Each view operates independently, so you can leave one to display all projects.
Screenshot - Workspace - Working Set Menu Screenshot - Workspace - Select Working Set

The working set type 'Resource' should be selected, and check the projects which you would like to be included.  Most new project wizards allow you to add the new project to any number of existing working sets, but occasionally you will have to add the project later, separately.
Screenshot - Working Sets Screenshot - New Working Set Type Screenshot - New Working Set Projects

You can select any number of working sets that you would like to dislay through the "Select Working Sets" dialog, or quickly switch to one with the menu in your workspace, and only projects in the selected sets will be displayed.
Screenshot - Working Sets (with new) Screenshot - Workspace with Working Set selected

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <br> <p>
  • Lines and paragraphs break automatically.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.