Distributing eclipse with UI customizations - eclipse

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!

Related

How can I export Eclipse compiler settings to a file?

In Eclipse I have exported code formatting, cleanup, import orders etc to files and checked them into svn.
This is useful for my team so that they can all use the same setup.
However, I can't find a way to do the same for Compiler options. There are quite a few useful settings that aren't switched on by default and its error prone for everyone to change them manually.
I know that I can use FindBugs (and we do through CI) but the Eclipse compiler options are better integrated and faster.
The best way to share all of those settings is to use Project-specific settings. Open the Project properties and select the various sections that you want to configure (for example, Java Compiler, then select the option Enable project specific settings.
Any settings you configure this way are stored in the project in a folder named .settings. Check that folder in to source control along with the .classpath and .project files, and whenever the project is checked out Eclipse will automatically apply the settings. Workspace settings are overridden by project-specific settings, so using this technique it doesn't matter how other workspaces or users have their settings configured.
The answer of #E-Riz is perfectly correct. If you find that you need to synchronize more than the listed settings for your team members in the future, then you should also have a look at Googles workspace mechanic, which allows to automatically apply any set of preferences to a workspace and to check during each start if the local preferences are still valid for the shared setup.

How can I clean up Eclipse "run configurations"

I set my java runtime options in Eclipse's Window > Prefs > Java > Installed JREs > Default VM Arguments. Since this setting is sufficient for all my main() entry points, I do not bother with customizing the "run configurations". It looks like nice flexibility but I probably will never need it. I was worried that I would have to repeat my VM arguments in the run configurations and so I started to copy my VM arguments but after an experiment it seems that I do not have to. Now I will have the opposite worry that I have some unintended customizations.
To eliminate the second worry, is there a way to eliminate the clutter visible in the Run drop down menu? What about the "Launch configurations" visible in the JAR export dialog? Is a run configuration the same thing as a launch configuration? How do I eliminate the multiple launch configurations?
I am on Eclipse Indigo on Ubuntu.
Edit After I manually delete all the run configurations, and proceed to do an export, buttons are greyed-out so I can't proceed. When I select the launch configuration drop-down, I end up with only one choice, from an unrelated project. I then created a run configuration for the real main entry point for the current project. I expect the clutter will return as I continue to use Eclipse.
One simple way would be to organize your projects by Eclipse workspace, which would limit the "run configurations" list only to the project referenced in a given workspace.
Switching workspaces would reset that list to the ones recorded for the projects of the new workspace.
Note: the OP's answer regarding launches file location isn't the only location possible.
The official one is:
${WORKSPACE}/.metadata/.plugins/org.eclipse.debug.core/.launches
But you can copy them enywhere else you want (as explained in "How do I save Eclipse launch profiles across workspaces?"), either by manually copying those files or by sharing them:
See "Which eclipse files belong under Version Control".
Once you know where they are saved, a simple delete is enough to make them disappear from the launcher menu.
The answer comes from #Francisco Puga
Experimental evidence shows that deleting "launches" seems to make run configurations disappear so it would seem that they might be synonymous.

New to Aptana, two questions on deployment

I've moved to Aptana from DW (mainly to get better Phonegap/Android integration). I'm using Aptana integrated into Eclipse (i.e. installed Eclipse and then added Aptana).
I have two questions.
How can I configure Aptana/Eclipse to copy files to my local development server when I want to test? I can clearly do this in the filesystem outside the IDE, but would like it inside on a button or menu.
How can I configure the process to use, for example, the Google closure tools for js and css as part of my build/deployment process? I'd like to automatically minify the js and/or be able to use the css extensions offered (variables).
I get the feeling that all this should be possible since Eclipse is so configurable, but I don't know where to start. Would Ant do this for me? How?
Would appreciate some pointers.
Thanks
Abo
I can answer your first question.
If you have the Aptana plug-in installed, you will have an option on your right-click menu titled "Deploy". Expanding the deploy setting will reveal the option to "Run Web Deployment Wizard...". From here, if you are using a web server as mentioned, you will probably want to choose the FTP/SFTP/FTPS option. Fill in the form with your servers information and be sure to run a test to make sure things are working properly.
I always check the "Automatically sync my changes with the remote site" box and then select the "Automatically sync in both directions" radio button. This will automatically deploy my current file to my web-server upon a save.
You may also want to only select the "Automatically sync from my machine to remote site", the reason I choose both ways is because I sometimes work from different machines and it helps me keep things in sync. A little tweaking and it should save you a lot of time and effort!
[Using Indigo Release 1, and Aptana Studio 3]
Aptana don't include support for "Google Closure", you can instead use "Eclipse" or "WebStorm".
I hope below links will help -
http://www.daveoncode.com/2009/11/23/automatically-compile-javascript-applications-using-google-closure-and-ant/
and this stack exchange thread -
Google closure compiler usage WebStorm

Specific plugins per workspace

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.

Maintaining a common set of Eclipse preferences

Whenever I switch workspaces/Eclipse installs I need to copy/redo the preferences:
compiler settings;
font sizes/families;
code formatter;
java code templates;
editor templates;
code clean-ups;
I would like to maintain these settings in an unitary way, preferrably under source control. How can I do that?
I know about 'copy settings' when creating a new workspace, but it does not keep updated copies.
You could of course export/import those settings.
The other approach is to enable project specific settings for some settings.
We have a very small Git repository with those kind of files:
.settings/org.eclipse.jdt.core.prefs (compiler problem settings and formatter rules)
.settings/org.eclipse.jdt.ui.pref (cleanup rules, common code templates)
The common settings are just copied/merged in each projects .settings directory, ensuring common rules amongst all projects, whatever the workspace.
You could also try Workspace Mechanic. It works perfect for this.
http://code.google.com/a/eclipselabs.org/p/workspacemechanic/
Eclipse now ships with a tool called Oomph Setup. This tool can be used to record the preference changes that happen in your workspace, synchronize those preferences across multiple machines using an online service, and apply the preferences to both new and existing workspaces.
"Oomph" is actually a broader set of tools and low-level frameworks that are used throughout the Eclipse installation process, and it provides for very powerful automation possibilities, so the documentation is sometimes hard to follow for an end user who's just interested in simple preference synchronization. Here are a collection of links about Oomph Setup that I found helpful:
Oomph: A Matter of Preference -- Blog post providing overview of preference tool
Oomph Setup Documentation -- Official documentation
Automating Project-specific Eclipse Setups with Oomph -- Walks through how to set up Eclipse to have default settings for new workspaces and automatically update the settings for existing workspaces
You now have a good example of a separate project maintaining Eclipse preferences, as plugin.
See the saneclipse project from Lars Vogel.
You also have the associated vogellacompany/com.vogella.saneclipse repo, which will tweak and fine-tune the settings of:
com.vogella.saneclipse.preferences/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.preferences/.settings/org.eclipse.core.runtime.prefs
com.vogella.saneclipse.preferences/.settings/org.eclipse.core.resources.prefs
com.vogella.saneclipse.templates/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.fileextensions/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.fileextensions/.settings/org.eclipse.pde.core.prefs
Check out Pulse Freelance Edition. It has the ability to sync workspaces (commercial).