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.
Ctrl + D. Deletes current line in the editor. Command + Shift + O.
Switching between Open Editors Ctrl + Page Up and Ctrl + Page Down—Navigate to previous or next file from the list of open files. Ctrl + Shift + T—Display a list of classes from the workspace. Ctrl + Shift + R—Display a list of resources from the workspace.
The Key Assist action which can be invoked by clicking Ctrl + Shift + L shows us all the accelerators or shortcut keys available in Eclipse. The key combination assigned to an action can be changed using the Keys preference page. There are many commands or actions in Eclipse for which there are no shortcut keys.
One of my most used shortcut is ctrl-2 L, which will automatically assign a variable with a name and import the necessary class. new View(); and press Ctrl-2 L, which results in: View view = new View();
Window->preferences->Java->Appearance->Members Sort
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