Format Source Code within Eclipse
The following instructions allow you to format Java source code file in Eclipse Java IDE
using FormatCode command line tool. We used Eclipse 3.1 Free Version, so if you use an older or
even a newer version then several screenshots or menu items may differ from our description.
Add a Tool Menu that will invoke FormatCode
1. Click "Run" -> "External Tools" -> "External Tools...".
2. Please fill in the form as show below: (Assuming you installed FormatCode in C:\Program Files\FormatCode\)
- Name: FormatCode
- Location: C:\Program Files\FormatCode\FormatCode.exe
- Working Directory: C:\Program Files\FormatCode
- Arguments: "${resource_loc}"
3. Select "Refresh" page, set the settings as show below:
4. Click "Apply" button to save settings, then click "Close" button to close dialog box.
You may now invoke FormatCode command line tool by two ways:
1. By clicking "Run" -> "External Tools" -> "FormatCode".
With FormatCode Code Formatters, you can format and transform any foreign source code to meet your favourite coding style within Eclipse in several seconds!
|