Organize class source code

A

Alex314

Hi there, I'm looking for a tool (plugin for eclipse, or external
application) that organize the source code of a class.

For example, I wish it could move the getters and setters of a class
to the end of the class body, sort the non-getters/setters methods
alphabetically, etc.

By now I make that task with copy and paste, but there should be a
better way...

Any ideas?
 
V

voorth

Hi there, I'm looking for a tool (plugin for eclipse, or external
application) that organize the source code of a class.

For example, I wish it could move the getters and setters of a class
to the end of the class body, sort the non-getters/setters methods
alphabetically, etc.

By now I make that task with copy and paste, but there should be a
better way...

Any ideas?

Have you considered using an IDE? For instance, Eclipse has a nice
configurable Sort action that does exactly what you want.
I'm sure other IDE's (NetNeans, IDEA...) have similar functionality.

--Henk
 
D

Donkey Hot

Have you considered using an IDE? For instance, Eclipse has a nice
configurable Sort action that does exactly what you want.
I'm sure other IDE's (NetNeans, IDEA...) have similar functionality.

--Henk

I can't see such refactor-option in my Netbeans 6.1... Would be glad to
find one!
 
S

Seamus

Hi there, I'm looking for a tool (plugin for eclipse, or external
application) that organize the source code of a class.

For example, I wish it could move the getters and setters of a class
to the end of the class body, sort the non-getters/setters methods
alphabetically, etc.

By now I make that task with copy and paste, but there should be a
better way...

Any ideas?

Eclipse, right click on source panel , choose Source => Sort Members
 
D

Donkey Hot

Eclipse, right click on source panel , choose Source => Sort Members

Downloaded newest Eclipse, and tested.

It sure sorts after names, but that's not good enough for me;)

I would like to 1) define private members in my own order, meaning an id
first and other properties then.

2) Then generate getters and setters for them. That goes ok with all IDE's

But, later when the class is rather old already, I would like to add new
private properties to the class, and

3) rearrange the getters and setters, sorted after now modified private
member variables list..

Eclipse can sort stuff, first according to type of stuff, then
alphabetically. I want that it does not sort the private variables/objects,
but sorts getters and setters to be in similar order than the privates..
getter first and setter then for each property.

Whoa.. There is always need for improvements, I guess ;D
 
L

Lord Zoltar

But, later when the class is rather old already, I would like to add new
private properties to the class, and

3) rearrange the getters and setters, sorted after now modified private
member variables list..

Eclipse can sort stuff, first according to type of stuff, then
alphabetically. I want that it does not sort the private variables/objects,
but sorts getters and setters to be in similar order than the privates..
getter first and setter then for each property.

Whoa.. There is always need for improvements, I guess ;D

C'mon... we're all coders here. How hard would this be to implement?
Sounds like a 2nd year university project. Could probably be done in a
weekend... Right? hehe ;)
 
A

Alex314

I use the Rearranger, a plugin for IntelliJ Idea.

Seehttp://mindprod.com/jgloss/intellij.html

It is very configurable and gives you very fine control.

Thank you for your reply, I'll test IntelliJ and that plugin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top