Ignore:
Timestamp:
2009-04-08T13:27:32+12:00 (15 years ago)
Author:
kjdon
Message:

added support for new plugin option type: enumstring, which has a list of predefined values, but can actually take any value - an editbale combobox in gli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/cdm/Argument.java

    r17826 r18911  
    7272    /** An element of the argument type enumeration specifying a metadata set combobox control. */
    7373    static final public byte METADATA_SET_NAMESPACE = 9;
    74 
    75     ///////////kk added the number was 9, I changed it to 10//////////////
    7674    /** An element of the argument type enumeration specifying a text field. */
    7775    static final public byte URL = 10;
     76  /** An editable combo box */
     77  static final public byte ENUM_STRING = 11;
     78
    7879    /////////////////////////////////////////////////////////////////
    7980
     
    9495    /** The DOM element this argument is built around, if any. */
    9596    private Element element;
    96     /** If the argument is of type ENUM then this map holds all the various options. Each entry is an <option value> -> <description> mapping. */
     97    /** If the argument is of type ENUM or ENUM_STRING then this map holds all the various options. Each entry is an <option value> -> <description> mapping. */
    9798    private ArrayList option_list = null;
    9899    /** A default value for parameter-type arguments. May be a Perl pattern. */
     
    123124     */
    124125    public void addOption(String name, String desc) {
    125         if(type == ENUM && name != null) {
     126      if((type == ENUM || type == ENUM_STRING) && name != null) {
    126127            if(desc == null) {
    127128                desc = "";
     
    412413        if(new_type.equalsIgnoreCase(StaticStrings.ENUM_STR)) {
    413414            this.type = ENUM;
     415            option_list = new ArrayList();
     416        }
     417        else if(new_type.equalsIgnoreCase(StaticStrings.ENUM_STRING_STR)) {
     418            this.type = ENUM_STRING;
    414419            option_list = new ArrayList();
    415420        }
Note: See TracChangeset for help on using the changeset viewer.