In Eclipse IDE how do you customize the Java code style formatter to have it sort the class members with a specified order, for example to group all instance methods by visibility?
If the question is, "how do you customize the 'Source -> Format' command to re-order members?", I don't think it can be done. To change the order used for the 'Source -> Sort Members' command, change the "Members Sort Order" preference: "Window -> Preferences -> Java -> Appearance -> Members Sort Order"
I'm not sure when they added this functionality, but it seems to be there in 3.5:
Window -> Preferences
Java -> Editor -> Save Actions
Additional actions -> Configure ...
Code Organizing -> Members -> Sort Members
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With