Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
> 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
Eclipse UserFriend
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
Eclipse UserFriend
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: Thu Jul 10 04:36:54 EDT 2025

Powered by FUDForum. Page generated in 0.04878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top