Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: removed the eclipse instructions


Panel
borderStyle
borderStylesolid
titleOn This Pagesolid

Table of Contents
indent3

 

A code formatter for the Eclipse IntelliJ IDE that can be used across all DDF projects will allow developers to format code similarly and minimize merge issues in the future.

DDF uses an updated version of the Apache ServiceMix Code Formatter (http://servicemix.apache.org/developers/building.html) for code formatting. 

Load the Code Formatter Into the Eclipse IDE

DOWNLOAD THIS FILEddf-eclipse-code-formatter.xml (NOTE: Right-Click the link and Select Save Link As if the browser opens the file in another window).

...

In Eclipse, select Window → Preferences. The Preferences window opens.

...

...

Select the Edit... button and load the attached ddf-eclipse-code-formatter.xml.

...

Select the OK button.

Image Removed

Load the Code Formatter Into IntelliJ IDEA

DOWNLOAD THIS FILEddf-intellij-code-formatter.jar (NOTE: Right-Click the link and Select Save Link As if the browser opens the file in another window).Previously, in IntelliJ, we would just import the Eclipse settings. However, now there is a IntelliJ settings jar that will import the code styles.

  1. Open IntelliJ IDEA.
  2. Select File → Import Settings. The file selection window opens.
  3. Choose ddf-intellij-code-formatter.jar.
  4. Select OK. NOTE: this will restart IntelliJ.

Format Your Source Code Using Eclipse 

A developer may write code and format it before saving.

  1. Before the file is saved, highlight all of the source code in the IDE editor window.
  2. Right-click on the highlighted code.
  3. Select Source → Format. The code formatter is applied to the source code and the file can be saved. 

Set Up Save Actions in Eclipse

A developer can also set up Save Actions to format the source code automatically.

  1. Open Eclipse.
  2. Select Window → Preferences (Eclipse → Preferences on Mac). The Preferences window opens.

  3. Select Java → Editor → Save Actions.

  4. Select Perform the selected actions on save.

  5. Select Format source code.
  6. Select Format all lines or Format edited lines, as necessary. 
  7. Optionally, select Organize imports (recommended).
  8. Select the Apply button.
  9. Select the OK button.
    Image Removed

Format Source Code Using IntelliJ

...