Eclipse generate getters and setters with different format

Eclipse 3.1 allows me to generate getters and setters for variables in a class. But, the generated methods are not in the format I want. For instance, the following example class:

    public class Count {
        private int count;
    }

becomes the following when I generate getters and setters:

    public class Count {
        private int count;

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }
    }

but, I want it to generate:

    public class Count {
        private int count;

        public int getCount() {return count;}
        public void setCount(int count) {this.count = count;}
    }

Is it possible to make it do things that way?
HappyEngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JavatmCommented:
If you go to Window > Preferences > Java > Code Style > Code Template
You'll see Getter and Setter body.

You can also go to > Preferences > Java > Code Style > Formatter
To change the style of the java file that you want to generate.

Hope that help . . .
Javatm
JavatmCommented:
> Is it possible to make it do things that way?
Yes it is see my comments above.
JavatmCommented:
If this solves your question pls. close it thanks.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

HappyEngineerAuthor Commented:
It's not clear to me if that works. The value of the "Getter body" is "return ${field};". It doesn't seem to have any way to eliminate the newlines before and after that statement.
JavatmCommented:
Check my 2nd solution above go to formatter dude.
HappyEngineerAuthor Commented:
Thanks, but I don't see anything in the formatter settings that could be used to put single statement method bodies all on a single line while not messing up the formatting of normal methods.
shivamohanCommented:
I don't believe Eclipse currenlty has a distinction b/n single-line methods & multi-line methods.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.