I resorted to using a java "template" for this .... After completion, the cursor is sitting between the space after set and the lowercase variable name .... then press Esc and a couple of quick keystrokes changes the first variable name to capital and deletes he space after set. The space after set is to make sure I do that last capitalize the first letter of the variable name business. If I don't do it, the space shows up as an error in eclipse editor.

private ${return_type} _${variable_name};

/** @return ${what} */
public ${return_type} ${variable_name}() {
        return _${variable_name};
}

/** @param ${variable_name} ${what} */
public void set ${cursor}${variable_name}(${return_type} $ {variable_name}){
        _${variable_name} = ${variable_name};
}


On Mar 31, 2009, at 11:13 AM, TW wrote:


On Mar 30, 2009, at 9:43 PM, Chuck Hill wrote:


On Mar 30, 2009, at 9:27 PM, Sanford Selznick wrote:

Hello,

Eclipse offers "Generate Getters and Setters" from its "Source" menu.

Is there any way to have this feature add getters without the "get" prefix? I don't see any way to change this in the Java- >Code Style->Code Templates preferences.

There are other places in Eclipse that allow for no "get", but not this menu item specifically.

Any ideas?


No. This is more or less hardwired into Eclipse. I hate it, but I live with it.


Chuck

It drives me nuts too. With all the customization options in eclipse it's just crazy that you can define the signature for getters/setters.

Tim
UCLA GSE&IS

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com

This email sent to kieran_li...@mac.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to