My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

The assymetry in the way , (comma) is used to separate the items in parameter and arguments lists always causes problem when one wants to reorder that list in Java editor. Is that why Java allows trailing commas in array initializer? ;) may be.

The Reorder plug-in adds the following actions to the Java editor tool bar.

  • Swap backward (Ctrl+,)
  • Swap forward (Ctrl+.)

Basically the actions reorder the:

  • arguments of a class instance creation invocation
  • arguments of a method invocation
  • parameters of a method declaration
  • members of array initializer

and automatically adjust the ',' separator.

For example with caret at | in:

void method(int iii, String |sss, boolean bbb){}

pressing Ctrl+. (i.e. Control+period) or clicking on Swap forward tool bar button yields:

void method(int iii, boolean bbb, String |sss){}

or pressing CTRL+, (i.e. Control+comma) or clicking on Swap backward tool bar button with the original source yields:

void method(String |sss, int iii, boolean bbb){}

Powered by Google Project Hosting