mardi 4 août 2015

Formatting if-else in eclipse

is there any way to format if-else statement in eclipse where multiple conditions come in each line while pressing Ctrl+Shift+F ? I tried to fiddle around in Preferences -> Java -> Code Style -> Formatter, but was not able to find the right option to get it working.

The format that i am trying to achieve is as follows.

if(condition1 == true
       && condition2 == true
       && condition3 == true
       && condition4 == true
       && condition5 == true) {
    return 0;
}

Any suggessions?

Aucun commentaire:

Enregistrer un commentaire