Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336559 - [sort members] automatically organize code
Summary: [sort members] automatically organize code
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 15:29 EST by Martijn CLA
Modified: 2011-02-09 14:23 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martijn CLA 2011-02-07 15:29:36 EST
Build Identifier: M20100211-1343

it would be nice if there were an option to automatically organise code. I like to keep my files as
fields
enums
constructors
accessors
other methods

and each one of those ordered by access (first public, then protected, then private)

it would be nice if I were able to automatically do this.

Reproducible: Always

Steps to Reproduce:
enhancement, unreproducable
Comment 1 Deepak Azad CLA 2011-02-07 22:15:55 EST
Did you try 'Window > Preferences > Java > Appearance > Members Sort order' ? Does it not fit your needs ?
Comment 2 Deepak Azad CLA 2011-02-07 22:16:52 EST
(In reply to comment #0)
> Build Identifier: M20100211-1343
> 
> it would be nice if there were an option to automatically organise code. I like
> to keep my files as
> fields
> enums
See also Bug 218705.

> constructors
> accessors
> other methods
Comment 3 Dani Megert CLA 2011-02-08 01:57:23 EST
>it would be nice if I were able to automatically do this.
Besides what Deepak mentioned, you can enable the sorting on save, see 'Save Actions' preference/properties page.
Comment 4 Martijn CLA 2011-02-09 13:17:03 EST
I did not know that, thanks.
It would still be nice if, in addition to this, I could do this on the fly e.g. in a (context) menu or button (source/organise code?). Also, I miss the ability to do accessors separately. Should I mark this bug as closed and open a new one for that, or just keep this one?
Comment 5 Markus Keller CLA 2011-02-09 13:25:16 EST
> It would still be nice if, in addition to this, I could do this on the fly e.g.
> in a (context) menu or button (source/organise code?).

Source > Sort Members...

> Also, I miss the ability to do accessors separately.

See bug 72418.
Comment 6 Martijn CLA 2011-02-09 14:23:11 EST
Thanks Markus.
I'll go wash the egg from my face now.