tags:

views:

336

answers:

3

Hi,

I came across this post and wondered if there is a way to activate only a few of all of my installed plugins depending on the workspace I currently work in.

For example - If I organized my workspaces like this

/workspaces
 /java
 /jee
 /php
...

I don't need the Android-Plugin if I'm working on my JEE-Projects and so on.

I also came accross this, suggesting to deactivate some capabilities for each workspace. But this not an option, as apparently no plugin is registered as capability.

Thanks, m

Edit: BTW, I am using Eclipse 3.5 Galileo

+1  A: 

Eclipse plugins are expected to start only as needed, in a lazy manner. I'm not saying that all behave exactly that way, but if you write your own plugin, you'll see this is how the technology works, your plugin gets called only as needed.

So in Eclipse, if you configure your starting Perspective (Java for me) to have only the Views you need, the plugins that are used for other views should not be started. To do this, take the view away and save your perspective (Windows - Save perspective as).


In addition, in Ganymede, in Windows - Preferences - General - Startup and Shutdown, there is a list of plugins that should be started on startup, so you can edit that list. I didn't try to see if this works per workspace though.

KLE
Yes, I read about the lazy loading. But for instance the Android Plugin loads some stuff directly after Eclipse started, which is kind of annoying. Other plugins do that as well :(
moxn
And in my case, none of my installed plugins shows up in "Startup/Shutdown"...
moxn
@moxn They don't show up, but they start anyway? Can you check if there is a view that is opened on startup, that uses them? Try to avoid that view, by taking it away and saving your perspective (Windows - Save perspective as).
KLE
@KLE Well, at least this plugin loads independently from the view Eclipse is being opened in.
moxn
@moxn I didn't understand your last comment. Did you try to take away the corresponding _Views_ from your default _Perspective_, then restart Eclipse?
KLE
@KLE Well, I closed all views (I could not "save perspective" then) but when I restarted Eclipse, it opened with the JEE view and the "Android SDK Content Loader" started itself. This happens no matter with which view Eclipse is being started.
moxn
@moxn Let's make the difference between **Perspective and View**, in Eclipse. One perspective holds many views. So, now we know you default **Perspective** is JEE. So close most **Views** in that perspective by clicking on the 'X' for each view, just keep the simple ProjectExplorer view. Then save the Perspective as JEE. Then restart Eclipse, and we'll see :-)
KLE
@KLE Ah, okay. I was a bit too woozy and didn't think long enough :) Thanks for the hint. I finally managed to close all views and - tadaa - the plugin didn't load. Turns out that there was an Android Project still open in my Package Explorer which I forgot about (duh)
moxn
+3  A: 

Maybe you can achieve your goal but it needs lots of "customization work" so I would not do it for myself :)

  • Create a "minimal" Eclipse install with plugins you use all of your workspaces.
  • Create one dropins folder for every workspace and put all of your "workspace-specific plugins" into that folder.
  • Create an Eclipse shortcut for all workspaces and use something like "-data _workspacedir_ -vmargs -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=_dropindir_" in the shortcut.
  • Start eclipse with one of your new shortcuts.

Note that in this case you cannot switch workspace within Eclipse, you have to close the current one and start the new one using the corresponding shortcut.

UPDATE: I have found some Eclipse feature request for making this kind of setup easier if they will be implemented:

Csaba_H
Hmhm, okay. But doesn't this fight the purpose of the update manager where I can administrate all my plugins without pushing jars around? I would like to install Plugins via the UpdateManager for all workspaces and still be able to deactivate them for each workspace, with an option to activate them later on. But as it seems from your answer, this is not possible yet...
moxn
Updating is an issue, really. You can use different Eclipse installs for different workspaces. In this case you can use the update manager but you have to update each Eclipse installs separately. There is no easy solution I think :(
Csaba_H
I offered you a very good and simple solution... anyway, of course you can use the same workspace with different installs (just not at the same time).
zvikico
+3  A: 

You can use a different configuration folder for each Eclipse instance using the -configuration option when starting Eclipse.

On Windows, I would use a batch file (e.g. run-eclipse.cmd) which looks a bit like this (a bit different on Unix, more complex on OS X because of the app packaging):

eclipsec.exe -clean -configuration configs/%1/configuration

Execute it with your environment ID (e.g. run-eclipse.cmd java). I use eclipsec because I need the console output, but you can use the plain eclipse.exe executable. The -clean is not mandatory either.

Under my Eclipse installation folder, I will have a configs folder and under this folder I will have multiple configurations. Each config folder can have its' own plugins and folders. AFAIK, if you install plugins they will be installed in your configuration folder and not your main installation folder.

The structure you get is like this:

  • Eclipse Folder
    • plugins
    • features
    • configs
      • java
        • plugins
        • features
        • configuration
zvikico