Specific plugins per workspace - eclipse

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 Java EE-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

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:
Software Update must allow to install plug-ins into extension location
Support for multiple bundle pools

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

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.

Although my solution won't let you install plugins per workspace but will solve the problem.
The best way i found to do this is using different eclipse copies:
Extract officialeclipse.zip to two different places and install plugins you like per eclipse.

A bit late answer but if you want to manage many workspaces shortcut the following tool is very simple and helpful : http://www.xdreamteam.ch/downloads/eclipselauncher/
I use it for sorting my projects by customers and workspaces, and it launch the right workspace with all the necessary configurations needed for each.

Related

Distributing eclipse with UI customizations

I would like to use Eclipse in an intro programming class. Is there some way I can make some kind of preferences file or some such that I can distribute with it that would set defaults for:
which buttons are in the toolbar
which menus are enabled in the application
which context-menus are enabled
what kinds of completions are available
I'd like it to start with only completing words from the current document
that is no Java API completions or code generation or whatever
This can be done using Eclipse Preferences File. All you need to do is import preferences into your workspace.
You can also export the workspace folder itself & publish Eclipse together with a default workspace folder, which will contain all the preferences.
Then create a shortcut to start eclipse with -data <path to your workspace> parameter
I'd try the following:
Install Eclipse
Put the configuration files and workspace under version control and commit.
Configure Eclipse as required.
Check all the changes in the version control to understand what configuration files are relevant to my changes.
Continue as Zilvinas is suggesting.
Look into Eclipse Oomph. It essentially automates all the tasks that you need to do to set up a fresh dev environment.
Also of interest are Yatta profiles which do a similar thing based off Oomph.
They're pretty easy to set up and publish. Get your local eclipse working, record to a profile, publish the profile, get your students to consume said profile. We've used these in a professional environment to more easily on-board new devs!

Two eclipse installations with completely separate development environments

I am an Eclipse newbie (on Windows 7). Is it possible to have two Eclipse installations at the same time where one is customized for Python development (via PyDev), and the other for embedded C development (through GNU toolchains)? If so, how would one go about doing this? If one of the Eclipse environments is already installed, what should I pay attention to when installing the second environment? (Or is there another, completely different approach that only uses one copy of Eclipse, but multiple plug-ins? Just thinking out loud here.)
I am apprehensive of things (plugins, workspaces, environment variables, etc.) getting mixed up.
Just install the second Eclipse in a separate directory and use separate workspaces and there should not be any problem. Eclipse keeps all the configuration information about the installation in its install directory. All information about a workspace is kept in the workspace.
Get the zip-version of eclipse, unzip it into two different folders, and create a separate workspace for each of them. Then install plug ins etc.. This works on Linux; I don't see why it shouldn't work on Windows.

Can different IDE share a same workspace?

I would like to use Eclipse and Spring Tool Suite at the same time using the same workspace.
Is there a way to do that?
PS: I've tried deleting .lock file in .metadata directory. But after I open Eclipse again, it's regenerated.
Thanks in advance!
No, it is not possible. The workspace stores several piece of information that both IDEs require (e.g. the Eclipse file system model that stores the list of all projects).
There are two things you could do (if you really require to work with both components):
Install every plug-in of one of your IDEs into the other (presumably it would be easier to install your Eclipse plug-ins into STS, but it very much depends on what you have installed). Then, if you need, you can open two windows (Window / New Window from the main menu), and then manage your stuff as needed.
Maintain two installations with two different workspaces, that share a set of projects stored outside the workspace. However, I would not recommend this approach because
You have to refresh the projects in the other workspace (where you were not editing)
The automatic builders registered in both workspaces would execute much often, and even worse, they could be conflicting with each other.
If you only need to work with the same set of versioned projects in the Eclipse instances, then maybe it would be a better idea to create a Team Project Set of your projects, and check them out into both workspaces, and share your changes through the version control system.

Disable Eclipse plugins per workspace

I use Eclipse for different projects, each with its own workspace. They need quite a different set of plugins (SVN vs hg vs git, AppEngine vs Tomcat vs OSGi, and so on), and I have all those plugins installed and active all the time, which clutters the workspace quite a bit. I'd like to selectively disable plugins for each workspace.
Eclipse (3.6/3.7) has a UI for disabling some plugins. It's under Window->Preferences->General->Startup and Shutdown->Plugins activated on startup. However not all plugins are listed here.
To disable other plugins:
It's possible to have separate configuration (osgi.configuration.area) directories:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html%23osgiconfigurationarea
Simply copy eclipse_dir/configuration to a new location.
Make launchers for each of your workspace and add parameters to your workspace specific launcher, for example:
-data workspace_location -configuration new_location_for_configuration_dir .
You can disable osgi bundles (not same as plugins) by removing it's line from configuration_directory/org.eclipse.equinox.simpleconfigurator/bundles.info file.
The config.ini file in the custom configuration directory must contain this line:
osgi.configuration.cascaded=false
Another solution would be to define a perspective for each workspace, and customize that perspective.
In each one, you can deactivate menu and commands of plugin you do not want, even though those plugins remains loaded.
That help removing some of the "GUI cluttering" caused by the various plugin.
When you switch workspace, you will restore the perspective you were using with the new workspace.
Eclipse has a notion of local and global configuration that might help you. When you start Eclipse with the -local {localDir} argument, Eclipse uses a writable local configuration in {localDir} and treats the (global) install configuration as read-only. Thus, you can install common features in the global configuration (when not using the -local flag), and install local features into the local configuration. In your case, to get per-workspace configurations, you can adopt the convention that the local configuration is inside or beside your workspace directory (though if inside, not managed as an eclipse resource or project), and then always launch pointing at that directory (e.g., eclipse -data {workspaceDir} -local {workspaceDir}/localConfig).
I solved that problem by having two separate eclipse "installations". It isn't the most beautiful solution, but does the job.
Here it is suggested to use General -> Capabilities, but that doesn't seem to exist in 3.5

Is there a NetBeans equivalent to Eclipse's Workspace

I enjoy using NetBeans, especially for development with Maven, however, I've found recently that I've been working with three different branches of the same code base in different parts of the development cycle.
One of the things that Eclipse can do is separate the projects into different workspaces, so I can simply start Eclipse with the workspace containing my Maven projects in the production patch branch or the trunk depending upon what I need to be working on.
I'd love to accomplish this in NetBeans, but haven't found a way to do so. Any ideas?
I am using Mac OS with version 6.7.1.
There is the option of project group.
In File > Project group.
In here you can create a project group based on a folder location, so any projects underneath this folder will be considered within this project group.
When switching between project groups only projects within are displayed, and it maintains the current status of opened files, etc.
Switching between project groups doesn't require closing the IDE.
Given those options I believe this would be equivalent to the workspace switching in Eclipse.
I've found two things:
First there is a "similar" feature. It involves using the userdir switch on the command line. The downside being you would need to restart your IDE rather than switching while open. I think I can live with that for the time being. I found the technique here for Windows:
Create a shortcut on your desktop to the Netbeans executable: C:\Program Files\NetBeans x.x\bin\netbeans.exe
Right-click on the shortcut and click "Properties".
In the "Target" textbox, add the extra parameter to the very end: --userdir C:\path\to\new_workspace
Click "OK" to exit the Properties window and double click the shortcut. Netbeans will launch and create/load the workspace at that location
Secondly, someone has submitted a feature to allow for workspace switching (or in this case userdir switching) from the IDE itself. Perhaps this will be rolled into 7.0.
Well Netbeans has a group so you can create a group of projects which you want to say put in a eclipse workspace otherwise.
So when you switch a group it's like switching workpsace in eclipse
I know, that this question is old, but I found it on google, while I was searching for a tool like the following:
http://plugins.netbeans.org/plugin/20677/project-group-toolbar
With that plugin, you can load different projects in your projects overview.
So you can have two or more projects open and change to another "set" of projects.
Neither projects or project groups do not work in a similar way as an Eclipse workspace (yet) as far as I know. When switching workspaces in Eclipse, all the files opened will be closed and the ones in the new project will be opened. In this way, all projects work as one entity. The netbeans project/project groups do not work in that way. I hope there will be such a feature soon cause that really helps if you have many windows open and you switch between projects
I'm looking for solution and finally use Project Group solution, this feature has been improved and easy to use.
Userdir is a good solution at first (i tried to use it first), but "workspace switching" feature doesn't exists, so I have to use different shortcut for different workspace. Finally I used Project Group
NetBeans' equivalent is the "Project". In your project explorer you can right click on the current project and close it. Then go to File > Open Project and select a different branch. You will have to create a new project from each branch of your code.