Changeset 20441 for gli


Ignore:
Timestamp:
2009-08-30T18:43:26+12:00 (15 years ago)
Author:
kjdon
Message:

metadata arguments use an editable combobox, which seems to mean that getting the selected value always returns a string, not a metadata element.

File:
1 edited

Legend:

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

    r18911 r20441  
    412412      case Argument.METADATUM:
    413413      case Argument.METADATA:
    414     new_value_raw = ((JComboBox) value_control).getSelectedItem();
    415     if (new_value_raw instanceof MetadataElement) {
    416       argument.setValue(((MetadataElement) new_value_raw).getFullName());
    417     }
    418     else {
    419       // But we have to be careful as an arbitary string object could be zero length
    420       String new_value = new_value_raw.toString();
    421       ///ystem.err.println("The current value is: " + new_value);
    422       if(new_value.length() > 0) {
    423         argument.setValue(new_value);
     414      String meta_value = (((JComboBox)value_control).getSelectedItem()).toString();
     415      if(meta_value.length() > 0) {
     416         
     417          argument.setValue(meta_value);
    424418      }
    425419      else {
     
    437431        return false;
    438432      }
    439     }
     433     
    440434    argument.setAssigned(true);
    441435    return true;
Note: See TracChangeset for help on using the changeset viewer.