-
Eclipse
-
Eclipse 2.1
-
Java Conventions
By default Eclipse built in formatting profile is used. Eclipse also provides you with the option to create a new profile using existing profiles as the template. You can also import a profile if you have one. It is advisable to share the same formatting settings among the team to avoid back and forth changes.
You cannot modify the built in profile settings. Here we will see how to create a new profile and increase the line wrapping width to avoid the default 80 pixel width line wrapping which can be make the code to look clumsy.
Go to Windows -> Preference as shown below:

Expand Java-> Code Style -> Formatter

Enter Profile Name and select the profile setting you want to start with. We chose Java Conventions

Change the line width by going to Line Wrapping section as shown below.

If you prefer not to have wrapping Uncheck "Prefer wrapping outer expressions" checkbox.
That's It!
|