Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Replaceing alle fields with getter and setter?
Replaceing alle fields with getter and setter? [message #861732] Sat, 28 April 2012 14:13 Go to next message
Rudolf Schmidt is currently offline Rudolf Schmidt
Messages: 15
Registered: April 2012
Junior Member
Hi,

I know there is a way to replace all fields with getter and setter, but you have to select them individualy. Is there also a way to replace all fields with getter and setter with a single action?
Re: Replaceing alle fields with getter and setter? [message #865178 is a reply to message #861732] Mon, 30 April 2012 05:18 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
Menu item 'Source->Generate getters and setters' should work for you..
Re: Replaceing alle fields with getter and setter? [message #865316 is a reply to message #865178] Mon, 30 April 2012 06:39 Go to previous messageGo to next message
Rudolf Schmidt is currently offline Rudolf Schmidt
Messages: 15
Registered: April 2012
Junior Member
Satyam Kandula wrote on Mon, 30 April 2012 05:18
Menu item 'Source->Generate getters and setters' should work for you..


Please read what I wrote. I said how to replace the FIELDS with getter and setter, not how to generate simple getter and setter for a certain class.
Re: Replaceing alle fields with getter and setter? [message #867648 is a reply to message #861732] Tue, 01 May 2012 08:00 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
On 4/28/2012 11:43 PM, Rudolf Schmidt wrote:
> Hi,
>
> I know there is a way to replace all fields with getter and setter, but
> you have to select them individualy. Is there also a way to replace all
> fields with getter and setter with a single action?

The Encapsulate field refactoring works on a single field at a time.

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Re: Replaceing alle fields with getter and setter? [message #867834 is a reply to message #867648] Tue, 01 May 2012 10:00 Go to previous messageGo to next message
Rudolf Schmidt is currently offline Rudolf Schmidt
Messages: 15
Registered: April 2012
Junior Member
Deepak Azad wrote on Tue, 01 May 2012 08:00
On 4/28/2012 11:43 PM, Rudolf Schmidt wrote:
> Hi,
>
> I know there is a way to replace all fields with getter and setter, but
> you have to select them individualy. Is there also a way to replace all
> fields with getter and setter with a single action?

The Encapsulate field refactoring works on a single field at a time.


then its time to change it, netbeans offers this feature already.
Re: Replaceing alle fields with getter and setter? [message #867932 is a reply to message #867834] Tue, 01 May 2012 10:57 Go to previous messageGo to next message
Michael Pellaton is currently offline Michael Pellaton
Messages: 289
Registered: July 2009
Senior Member
> then its time to change it, netbeans offers this feature already.

Really? If so, I see two options:

1. You provide a patch implementing that feature.

2. Go and use NetBeans if it better fits your needs.

HTH
Michael
Re: Replaceing alle fields with getter and setter? [message #868042 is a reply to message #865316] Tue, 01 May 2012 12:07 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 975
Registered: July 2009
Senior Member
Rudolf Schmidt wrote on Mon, 30 April 2012 12:39

Please read what I wrote. I said how to replace the FIELDS with getter and setter, not how to generate simple getter and setter for a certain class.


You could have helped avoid the misunderstanding by being more specific, like "how to replace all accesses to fields ...", you don't want to actually replace the fields Smile

best,
Stephan
Re: Replaceing alle fields with getter and setter? [message #868575 is a reply to message #867834] Wed, 02 May 2012 04:41 Go to previous message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
There is a bug opened for this -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=106693. Do you wish to
work on this ?

--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
Previous Topic:NoClassDefFoundError: org/codehaus/classworlds/Launcher
Next Topic:Reading classpath entry
Goto Forum:
  


Current Time: Tue Jul 22 09:41:31 EDT 2014

Powered by FUDForum. Page generated in 0.02660 seconds