Community
Participate
Working Groups
I think many programmers like to use chained setters, or "fluent interfaces" [Fowler]. It would be nice to have a generator, or an option in Generate Getters and Setters, to create a chainable setter method. E.g.: Public <type> <field_name>(<field_type> new<field_name>) { set<field_name>(new<field_name>); return this; }
> It would be nice to have a generator, or an option in Generate > Getters and Setters, to create a chainable setter method. ... in *addition* to the normal void setter.
Not the first request for more configurability of getter/setter templates. To make this happen we have to rewrite our code how code templates for getter/setters are used. We will have to see if we find time to do that: - Allow to define more than one getter/setter template, and let the user choose one in the getter/setter wizard. Other features that generate a getter/setters (code assist, refactorings) might have to just take the default template if we don't have the possibility to show a UI - change from getter/setter body and comment templates to templates for the full signature. I'll add this as a plan candidate item.
We can just add a new option: return this or not to the "Generate Getters and Setters" dialog. This feature is low-hanging fruit, but quite useful to our developers. People been asked for it multiple times in stackoverflow. https://stackoverflow.com/questions/12294627/generate-setters-that-return-self-in-eclipse https://stackoverflow.com/questions/12294627/generate-setters-that-return-self-in-eclipse