Ignore:
Timestamp:
2005-07-26T11:56:46+12:00 (19 years ago)
Author:
kjdon
Message:

made the username property optional

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/anttasks/MyGetUserAndPassword.java

    r10299 r10307  
    3030 *  <getuserandpassword
    3131 *       message="a message to display at the top of the dialog"
    32  *       userproperty="the name of the username property to set"
     32 *       userproperty="the name of the username property to set (optional)"
    3333 *       pwordproperty="the name of the password property to set"
    3434 *       username="default value for username (optional)"
     
    9090        return;
    9191    }
    92     if (user_property == null || pword_property == null) {
    93         throw new org.apache.tools.ant.BuildException("userproperty and pwordproperty attributes must be specified");
     92    if (pword_property == null) {
     93        throw new org.apache.tools.ant.BuildException("pwordproperty attribute must be specified");
    9494    }
    9595   
     
    133133        name_field.setText(username);
    134134    }
     135    if (user_property == null ) {
     136        name_field.setEditable(false);
     137    }
    135138    JLabel pass_label = new JLabel("Password:");
    136139    pass_field = new JPasswordField(16);
     
    184187    }
    185188   
    186     getProject().setProperty(user_property, username);
     189    if (user_property != null) {
     190        getProject().setProperty(user_property, username);
     191    }
    187192    getProject().setProperty(pword_property, password);
    188193   
Note: See TracChangeset for help on using the changeset viewer.