Reputation: 2517
I would like the Package Explorer view, if possible, just to show the order in which things are defined in the source file.
I know that, in the Java-->Appearance-->Member Sort Order preferences, you can set what order categories of definitions appear (fields, methods, inner classes, etc.), but not the order within these categories. (Well, you can order by visibility within these but nothing else.) It appears to only do alphabetical order within this categorisation.
The Quick Outline view (Ctrl-O) does this as-in-the-source ordering, and I could also collapse all code blocks to get a similar outline in the editor, but I prefer using the Package Explorer for navigation.
For example, for a class implementing multiple interfaces, I group the methods by interface, and keep the method order as defined in the interface. Plus I separate off private utility methods, etc. As I'm sure most people do, I'd also default to ordering by visibility when there aren't any well-defined 'logical areas' of the class, and would tend to have 'sub-methods' below their callers.
(It would be even better if it were possible to drag and drop definitions to reorder them in the file, although the collapsed editor view is pretty good for this.)
What, if anything, would get me closer to this view? (Or, if you like, are there any reasons why this desire is stupid?)
Upvotes: 3
Views: 922
Reputation: 32984
It does seem like a strange omission to not be able to disable the alphabetic sorting. A little investigation turns up some bug reports that are marked as WONT-FIX (basically because the people who proposed them didn't follow up):
As a work-around, you can consider using the Members view, which does allow you to toggle alphabetic sorting. I actually use it all the time because it's part of the Java Browsing perspective, which I much prefer over the Java perspective. Even if you don't want to use Java Browsing, you can open the Members view in your perspective of choice. For example, open it and drag it to place below your Package Explorer view.
Upvotes: 4