RE: Add Key template

From: JR Ruggentaler (JR.Ruggentale..pv.com)
Date: Mon Mar 19 2007 - 23:29:17 EDT

  • Next message: Kieran Kelleher: "Re: Add Key template"

    eclipse has the Source->Generate getters and setters that does basically
    what you are trying to do.
     
    J.R.

    ________________________________

    From: Kieran Kelleher [mailto:kieran_list..ac.com]
    Sent: Monday, March 19, 2007 10:12 PM
    To: woproject-de..bjectstyle.org
    Subject: Add Key template

    I created a java editor template to substitute for the loss of
    WOBuilder's Add Key.. utility. So, this template:

    protected ${return_type} _${variable_name};

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

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

    ........produces this code for example.........

    protected Object _sectionForListItem;

    /**..eturn the section grouping identifier for the current
    <code>listItem()</code> */
    public Object sectionForListItem() {
    return _sectionForListItem;
    }

    /** param the section grouping identifier for the current
    <code>listItem()</code> */
    public void setsectionForListItem(Object sectionForListItem) {
    _sectionForListItem = sectionForListItem;
    }

    Anyone got a tip on how to make it capitalize the variable name in the
    set statement so I get setSectionForListItem instead of
    setsectionForListItem ?

    Thanks, Kieran



    This archive was generated by hypermail 2.0.0 : Mon Mar 19 2007 - 23:29:21 EDT