Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Grab helix-style.xml
  2. Go to Window (or Eclipse on Mac) --> Preferences --> Java --> Code Style --> Formatter
  3. Click Import...
  4. Browse to the file and click OK
  5. Make sure "Helix" is selected as the active profile if you plan to use it globally (see Project-Specific Settings otherwise)

To use:

  1. Source --> Format

Project-Specific Settings

If you use Eclipse for multiple projects, it is possible to enable the formatter on a project-specific basis.

  1. Right click the project, select Properties
  2. Go to Java Code Style --> Formatter
  3. Check "Enable project specific settings"
  4. Ensure that "Helix" is selected as the active profile
  5. Go to Java Editor --> Save Actions
  6. Check "Enable project specific settings"
  7. Check "Perform the selected actions on save" and "Format source code"
  8. Select "Format all lines"

IntelliJ IDEA

To import:

  1. Grab helix-style.xml
  2. Go to File --> Settings --> Plugins --> Browse For Repositories...
  3. Search for "Eclipse Code Formatter," right click to install, apply settings, and restart IDEA
  4. Go to File --> Settings --> Eclipse Code Formatter for the Helix project
  5. Select "Use the Eclipse code formatter"
  6. Browse to the format file for "Eclipse Java Formatter config file"
  7. Apply settings

...