Reputation: 1702
On formatting my code Ctrl + Shift + f This is how my code looks
if (item == null) {}
Is it possible to get it formatted like
if(item == null) {}
Thanks,
Upvotes: 2
Views: 978
Reputation: 8484
You can configure formatting profiles on Eclipse.
Just go to Eclipse preferences > Java > Code Style > Formatter.
As the other answer specifies (damn it, that was fast!) you'll find the particular option you're looking for on the before opening parenthesis
checkbox displayed when selecting control statements > 'if else'
on the white space
tab on the edit profile
dialog.
Check out these resources too:
http://www.ralfebert.de/archive/java/source_formatting/
Upvotes: 2
Reputation: 7069
You can go to Window > Preferences > Java > Code Style > formatter > Edit > and uncheck option "before opening parenthesis".
Upvotes: 7