Search code examples
intellij-idea

How to sort class members in existing code in Intellij IDEA?


I worked in Eclipse before, but IDEA seems more comfortable for me.

I want to press some hotkey to order all source members.

There's an option: Project settings - Code Style - Java - Code Generation - Order of members. But it doesn't work with an existing code.

How can I sort them by category (like Static Inner Classes, then Inner Classes, then Static fields etc...) and alphabetically in each category?

Is there a possibility to do this in IDEA? May be, with some plugin?


Solution

  • In IDEA 11 you can use Rearranger plug-in, IDEA 12 will support it out of the box.