Eclipse allows Java class files to use custom formatting and templates. The normal way to change these settings is from the Windows | Preferences menu and then Java > Code Style in the preferences dialog. The formatter governs how braces, indentation etc. works. The template governs what sort of file, class and method headers appear in a new class file.
I have two files for these settings which I must import and set to take effect. Sometimes I create a workspace and forget to set the template. Then formatting picks up the wrong style or omits the boiler plate which if I don't catch at checkin time. This causes the file to be non standard and can cause merge conflicts for other people and vice versa to me if they make the mistake.
Is it possible to modify Eclipse easily so that it always defaults to the custom formatting and template when creating a new workspace? Even if I have to put the XML into the Eclipse folder somewhere and tweak some setting I would like to be able to do this and put instructions out for others in my team to do the same.
Have a look at Workspace Mechanic. It synchronizes workspace properties over different workspaces. So also new one. You can copy your reference-workspace configuration into the workspace mechanic directory and it will automaticcally be installed in new workspaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With