|
DynamicWorkingSets
Dynamic Working Sets for Eclipse.NewsFollowing another suggested enhancement, I've set up the regex working sets so they will also include closed projects. I may make this an option at some point. Following a suggested enhancement, I've added M2Eclipse support - you can now set up a working set based on a regular expression for the group and/or artifact ids of a maven project. Note on closed projectsThe regular expression working set will include all projects that match the regular expression, regardless if they are open or closed. The nature and maven working sets require examination of project contents that cannot be performed when a project is closed. These working sets will only include open projects. IntroductionWorking sets are a great way to organize your projects in eclipse. However, it's up to you to add/move/remove projects. I was working with a group, and whenever we checked different groups of projects out, we'd have to do the old "drag 'em into the working sets" dance. I got tired of this, and dynamic working sets were born. Dynamic working sets automatically manage their contents based on regular expressions or project natures. Nifty! The eclipse API never ceases to amaze me! InstallationYou can grab the dynamic working sets feature at http://javadude.googlecode.com/svn/trunk/com.javadude.updatesite If you're not sure how to use the Eclipse Update Manager open the Eclipse Help->Help Contents, and read the section under Workbench User Guide->Tasks->Updating Features with the update Manager->Installing new features with the update manager. Choose "JavaDude Automated Working Sets Feature" Note: If you select the "JavaDude Dynamic Maven Working Set Feature" you must have m2eclipse installed or you will not see the maven working sets appear.
UseFirst, we need to define a dynamic working set. I'll use the regular expression working set as an example. I really like to use the Top Level Elements->Working Sets option in the Package Explorer (it's off the little upside-down triangle option menu on the Package Explorer toolbar.) Unfortunately, if this option is turned on, you can only create Java Working Sets!. So before you create a dynamic working set, you must turn it off:
Now let's define the working set. Choose Select Working Set...
Press New... and you'll see the New Working Set Dialog
The JavaDude Dynamic Working Sets feature adds two new options
Select "Regular Expression Working Set" and press Next....
Here you specify a label for the working set (which will appear in the package explorer if you have Top Level Elements->Working Sets selected), and a regular expression that will select which projects should be included. If you need help with the regular expression, press control-space when the cursor is in that field. Content assist will appear in the same manner it does in the standard Eclipse find/replace dialog. Note: The regular expression must fully match the project names. If you want to specify just a prefix, you must end the expression with .* . As you change the regular expression, you'll see the projects in the workspace that match it. When done with the settings, press Finish. Alternatively, you can create a Project Nature Working Set:
Name the working set, select the nature(s) you would like to include, and press Finish. You can also select a Dynamic Maven Working set. Setup is similar to the regular expression working sets but the regular expressions apply to the group artifact ids of your m2eclipse projects. If you like to use the Top Level Elements->Working Sets, switch back to it now.
Next, choose Configure Working Set... (If you're not using Top Level Elements->Working Sets, you can select which working set to use from the Select Working Set dialog where we created the new working sets.)
You'll see the Configure Working Sets dialog.
Check the working sets that you would like to appear in the Package Explorer and press Ok. You should now see your working sets in the package explorer. The dynamic working sets will automatically manage their projects based on project name (for regular expression working sets) or project natures (for project nature working sets). At my last job, I defined a few extra project natures (in a plugin) for organization and created separate instances of nature working sets for each. It really helps keep things organized! Feel free to contact me at scott@javadude.com with questions or comments! Please let me know if you find this feature useful! LicenseCopyright (c) 2008 Scott Stanchfield. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html |
Sorry, but I could not make it work on Eclipse 3.4 and 3.5M5. Maybe I will try it after a while
Can you give me more details on what went wrong?
I just tried on a clean eclipse 3.4.1 and it worked.
A couple of things to try:
I'm working on both of the above issues, trying to get common auto-selected as a dependency and trying to find a way to allow these working sets to be specified when in "Top-Level Elements->Working Sets" mode.
I've updated the plugin to automatically include JavaDude? Common feature
works for me on eclipse 3.5; thanks for the very useful plugin!
Awesome! Glad you like it! I've been loving it ever since I wrote it!
At my last job we'd assign one of several custom project natures that we created to our projects. This gave a great automatic separation between web apps, client apps, web query plugins, data provider plugins and so forth. Cool stuff.
Enjoy! -- Scott
Thank you very much for showing this and saving several days work for me. If this wasn't there I would have started developing more or less the same thing. The only thing more powerful could be a 'scriptable' working set (using Eclipse/GroovyMonkey? or something), I might still do that sometime.
Maybe you could mention in the description which Eclipse versions does this work with?
The link to the dynamic working set points elsewhere. I tried it with the URL captured in the screenshot below and it worked (I fed it to my eclipse install new software...
Cheers, Barak
I faced the same problem with the URL shown in the Installation section. Pasting the correct URL (might be useful for others).
Use this link: http://javadude.googlecode.com/svn/trunk/com.javadude.updatesite
And thanks a lot for the plugin!
Cheers, Hemanth
Sorry about that! I converted my repo to Mercurial to try it out and was fixing the image links - changed that too.
I changed that link back
I don't know why that link didn't work - it should have after I converted. I'll have to check into it, b/c if I use Mercurial I'll need to serve the updatesite from there (or explicitly upload the plugins somewhere)
Thanks for pointing out the problem! -- Scott
If you always forget to switch the top level element to "project" from "working set" like I do it may be easier to use the Navigator view to create dynamic working sets.
- Switch to Navigator View (Window -> Show View -> Navigator if it's not visible) - "Select Working Set..." in the view menu (triangle). - "New..." button to create them. - "Ok" to close the dialog. - Switch back to the Package Explorer view.
No need to change your top level element setting.
Excellent plugin. Many thanks for your contribution
Nice plugin but I would have preferred using the regular expression on the packages rather than the project name, that way it can be really powerful.
Still happy with this, but any chance to integrate to Eclipse marketplace? (it's builtin client is handy when I have to set up a new Eclipse install, easier to find useful plugins) Thanks,