Reputation: 2306
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.
Upvotes: 15
Views: 3627
Reputation: 55957
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.
Upvotes: 4