0

Possible Duplicate:
Sorting methods in Eclipse

When I format java code in eclipse using ctrl + shift + F. it does the formating but does not put together the pieces of code together. For example, I often mix up the variable declaration and functions one after other. Also forget to specify where to insert the getters and setters when generating source code. I want to all my final static variables first followed by member variables followed by getter setters and followed by other methods. Example: Unfomated code :

static final var1;
int var2;
void func1(){}
int var3;
void setVar3(){}
static final var4;
void func2(){}
int var5;
void setVar1(){}
int getVar3(){};

Formated Code :

static final var1;
static final var4;
int var2;
int var3;
int var5;
void setVar1(){}
void setVar3(){} 
int getVar3(){}
void func1(){}
void func2(){}

Is this possible?

Community
  • 1
  • 1
Nitiraj
  • 614
  • 1
  • 4
  • 15
  • 1
    I believe this question may be a duplicate: http://stackoverflow.com/q/854232/437226 Make sure you do some research before asking a question--it may have been answered before. http://stackoverflow.com/questions/how-to-ask – ramblinjan Mar 16 '12 at 18:40
  • Answered here: http://stackoverflow.com/a/854257/437226 – ramblinjan Mar 16 '12 at 18:40

0 Answers0