...
- Grab helix-style.xml
- Go to Window (or Eclipse on Mac) --> Preferences --> Java --> Code Style --> Formatter
- Click Import...
- Browse to the file and click OK
- Make sure "Helix" is selected as the active profile if you plan to use it globally (see Project-Specific Settings otherwise)
To use:
- Source --> Format
Project-Specific Settings
If you use Eclipse for multiple projects, it is possible to enable the formatter on a project-specific basis.
- Right click the project, select Properties
- Go to Java Code Style --> Formatter
- Check "Enable project specific settings"
- Ensure that "Helix" is selected as the active profile
- Go to Java Editor --> Save Actions
- Check "Enable project specific settings"
- Check "Perform the selected actions on save" and "Format source code"
- Select "Format all lines"
IntelliJ IDEA
To import:
- Grab helix-style.xml
- Go to File --> Settings --> Plugins --> Browse For Repositories...
- Search for "Eclipse Code Formatter," right click to install, apply settings, and restart IDEA
- Go to File --> Settings --> Eclipse Code Formatter for the Helix project
- Select "Use the Eclipse code formatter"
- Browse to the format file for "Eclipse Java Formatter config file"
- Apply settings
...