Formatting Source Code

On This Page

 

A code formatter for the 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 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).

  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 Source Code Using IntelliJ

In the toolbar, select Code → Reformat Code or use the keyboard shortcut Ctrl-Alt-L.