I am trying to keep functions related to each other close together. What would be the easiest way to rearrange methods within a class in Eclipse?
ALT+UP / ALT+DOWN works for code within methods, but moving the whole function around is a bit hard since it does not respect function boundaries.
Copy/Paste works, but I was hoping for something more elegant.
In the outline view you can rearrange methods with the mouse.
In the outline view you can drag and drop methods - you may need to unselect the alphabetic sort option.
Personally, I would not spend too much effort on re-ordering methods. I'd hope that your classes are small enough that it doesn't matter too much, and the outline view helps navigation too.
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