Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 346
Mikhail Kopylov Avatar asked Oct 08 '12 11:10

Mikhail Kopylov


1 Answers

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

like image 195
CrazyCoder Avatar answered Oct 10 '22 20:10

CrazyCoder