I开发者_运维问答'm looking for a shortcut, preference or plugin in Eclipse which will sort Java members by visibility modifier. Specifically, I'm looking for the class to be sorted like this:
public someClass {
//public variables go first followed by
//protected and default variables and lastly
//private variables
//public methods above
//proteted and default methods with
//private methods at the bottom
}
I'm not fussed about alphabetically, only the visibility modifier.
Window->preferences->Java->Appearance->Members Sort
(Alt-Shift-S),
Sort Members. A pop Up opens and you can select whatever you want.
I have no reputation that's why I answered
This is probably related:
How to specify the order of class members when formatting in Eclipse
精彩评论