An epf (Eclipse Preferences File) has been created and is available both as an attachment to this page Magnolia.epf and on our fileserver at /Product Development/Eclipse/Magnolia.epf (access restricted to Magnolia International devs only). This file needs to be imported into your Eclipse IDE and will automatically set the formatting options as specified in our code style page.
Go to File -> Import -> General -> Preferences
Make sure you Import all not only the Java Code Style Preferences.
The settings provided will only overwrite the following and should not interfere with other default or custom settings
- Java -> Code Style -> Formatter ("Magnolia" profile based on Eclipse-provided Java code conventions profile)
- XML -> XML Files -> Editor
- Java -> Editor -> Save Actions
- Java -> Code Style -> Organize imports
Alternatively, if you have access to our fileserver a zipped Eclipse Indigo bundle with the Magnolia.epf already set can be downloaded from /Product Development/Eclipse/ folder.
By default, this profile will automatically apply code formatting and imports re-ordering upon saving. You can also apply formatting and imports ordering manually by selecting a file or group of files, then right-click -> Source -> Clean up...
Make sure the active profile is Magnolia and NOT Eclipse [built-in]
Note: If you suspect that the correct settings are not being applied:
You may have to switch the active profile manually away from "Magnolia", click Apply, close and re-open the preferences, then switch the active profile back to "Magnolia" and apply again.