Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Generate getter / setter to create add/remove/addAll/removeAll for collections
Generate getter / setter to create add/remove/addAll/removeAll for collections [message #40272] Tue, 27 May 2003 04:55 Go to next message
Eclipse UserFriend
Originally posted by: j.verschoor.nefli.nl

Hello,

I'd like to create the following code generation functionality for fields
that are a Collection:


addXXX(Object o);
removeXXX(Object o);
addAllXXX(Collection c);
removeAllXXX(Collection c);

This is very common functionality. At least, in my code ;-)

I'd like to know if I should patch AddGetterSetterOperation /
AddGetterSetterAction, or create a whole new action. Personally I'd go with
AddGetterSetter, and for collections add another 4 checkboxes.
I'd like to know what you think, and I'd like to know what the eclipse team
thinks about it. I wouldn't want to be wasting my time because it won't be
included, or because somebody else is already doing this..


Joris Verschoor
Re: Generate getter / setter to create add/remove/addAll/removeAll for collections [message #40366 is a reply to message #40272] Tue, 27 May 2003 05:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: faust.acm.org

I would say its probably a candidate for a new action. With the added
functionality in the getter/setter dialog post 2.1 (see latest Nightly or
Integration builds), the dialog might be getting a bit crowded if we add yet
more choices to it. If you add a new action, you might use the
SourceActionDialog to do so.


Randy

"Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
news:bav90e$grp$1@rogue.oti.com...
> Hello,
>
> I'd like to create the following code generation functionality for fields
> that are a Collection:
>
>
> addXXX(Object o);
> removeXXX(Object o);
> addAllXXX(Collection c);
> removeAllXXX(Collection c);
>
> This is very common functionality. At least, in my code ;-)
>
> I'd like to know if I should patch AddGetterSetterOperation /
> AddGetterSetterAction, or create a whole new action. Personally I'd go
with
> AddGetterSetter, and for collections add another 4 checkboxes.
> I'd like to know what you think, and I'd like to know what the eclipse
team
> thinks about it. I wouldn't want to be wasting my time because it won't be
> included, or because somebody else is already doing this..
>
>
> Joris Verschoor
>
>
Re: Generate getter / setter to create add/remove/addAll/removeAll for collections [message #40643 is a reply to message #40272] Tue, 27 May 2003 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: faust.acm.org

Perhaps you can get the functionality you describe from the Generate
Delegate Methods action?


Randy

"Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
news:bav90e$grp$1@rogue.oti.com...
> Hello,
>
> I'd like to create the following code generation functionality for fields
> that are a Collection:
>
>
> addXXX(Object o);
> removeXXX(Object o);
> addAllXXX(Collection c);
> removeAllXXX(Collection c);
>
> This is very common functionality. At least, in my code ;-)
>
> I'd like to know if I should patch AddGetterSetterOperation /
> AddGetterSetterAction, or create a whole new action. Personally I'd go
with
> AddGetterSetter, and for collections add another 4 checkboxes.
> I'd like to know what you think, and I'd like to know what the eclipse
team
> thinks about it. I wouldn't want to be wasting my time because it won't be
> included, or because somebody else is already doing this..
>
>
> Joris Verschoor
>
>
Re: Generate getter / setter to create add/remove/addAll/removeAll for collections [message #41172 is a reply to message #40272] Tue, 27 May 2003 17:47 Go to previous messageGo to next message
Eclipse UserFriend
<j.verschoor@nefli.nl> wrote:

>Hello,
>
>I'd like to create the following code generation functionality for fields
>that are a Collection:
>
>
>addXXX(Object o);
>removeXXX(Object o);
>addAllXXX(Collection c);
>removeAllXXX(Collection c);
>
>This is very common functionality. At least, in my code ;-)
>
>I'd like to know if I should patch AddGetterSetterOperation /
>AddGetterSetterAction, or create a whole new action. Personally I'd go with
>AddGetterSetter, and for collections add another 4 checkboxes.
>I'd like to know what you think, and I'd like to know what the eclipse team
>thinks about it. I wouldn't want to be wasting my time because it won't be
>included, or because somebody else is already doing this..

In general the way to go is to stea., uups, no to mimic the structure
of an already existing plugin or action. At first this means
dublication, whichs is bad by default, but you can use all things
without breaking API.
I would take AddDelegateAction (or similiar), because there I have
done similiar things. There are some feature requests which are going
in the direction you also want to see.
I think its
https://bugs.eclipse.org/bugs/show_bug.cgi?id=35785
please add your thoughts.
I would not mind if you can provide the one or another method to speed
things up. So just take the Action and play around.

martin
Re: Generate getter / setter to create add/remove/addAll/removeAll for collections [message #41546 is a reply to message #41172] Wed, 28 May 2003 04:06 Go to previous message
Eclipse UserFriend
Originally posted by: j.verschoor.nefli.nl

Ah look at that.. That does what I want, except for the naming, but that's
in your bugreport

thanks for pointing out

"Martin M
Previous Topic:Java project directly from CVS
Next Topic:Cloaking of folders during build process
Goto Forum:
  


Current Time: Thu Jul 24 06:50:58 EDT 2025

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

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

Back to the top