Changeset 5864
- Timestamp:
- 2003-11-18T08:37:33+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java
r5758 r5864 91 91 setModal(true); 92 92 setSize(SIZE); 93 setJMenuBar(new SimpleMenuBar("designingacollection")); // can we tell whether we are doing a classifier or plugin, to make the help more specific?? 93 setJMenuBar(new SimpleMenuBar("designingacollection")); // can we tell whether we are doing a classifier or plugin, to make the help more specific?? 94 94 Dictionary.setText(this, "CDM.ArgumentConfiguration.Title"); 95 95 … … 323 323 Collections.sort(options_model); 324 324 value = new JComboBox(options_model.toArray()); 325 ((JComboBox)value).setEditable(true); 325 326 ((JComboBox)value).addActionListener(new ToolTipUpdater()); 326 327 if(existing_value != null) { … … 506 507 return argument; 507 508 } 508 509 509 510 public Object getValue() { 510 511 if(value instanceof JComboBox) { … … 536 537 case Argument.ENUM: 537 538 ListOption option = (ListOption)((JComboBox)value).getSelectedItem(); 538 if(option == null || option.getValue().length() == 0) { 539 String args[] = new String[1]; 540 args[0] = argument.getName(); 541 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.No_Value", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 542 return false; 543 } 544 result = option.getValue(); 545 if(result.length() > 0) { 546 argument.setValue(result); 539 if(option != null && option.getValue().length() > 0) { 540 argument.setValue(option.getValue()); 547 541 } 548 542 else { 549 if(argument.isRequired()) { 550 String args[] = new String[1]; 551 args[0] = argument.getName(); 552 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 553 args = null; 554 return false; 555 } 556 else { 557 argument.setValue(null); 558 } 543 String args[] = new String[1]; 544 args[0] = argument.getName(); 545 if(argument.isRequired()) { 546 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 547 } 548 // They've left the field blank 549 else { 550 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.No_Value", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 551 argument.setValue(null); 552 } 553 args = null; 554 return false; 559 555 } 560 556 argument.setAssigned(true); … … 582 578 } 583 579 else { 580 String args[] = new String[1]; 581 args[0] = argument.getName(); 584 582 if(argument.isRequired()) { 585 String args[] = new String[1];586 args[0] = argument.getName();587 583 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 588 args = null;589 return false;590 584 } 585 // They've left the field blank 591 586 else { 592 argument.setValue(null); 593 } 587 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.No_Value", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 588 argument.setValue(null); 589 } 590 args = null; 591 return false; 594 592 } 595 593 argument.setAssigned(true); … … 626 624 } 627 625 else { 628 if(argument.isRequired()) { 629 String args[] = new String[1]; 630 args[0] = argument.getName(); 631 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 632 return false; 633 } 634 else { 635 argument.setValue(null); 636 } 637 } 638 argument.setAssigned(true); 626 String args[] = new String[1]; 627 args[0] = argument.getName(); 628 if(argument.isRequired()) { 629 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 630 } 631 // They've left the field blank 632 else { 633 JOptionPane.showMessageDialog(self, Dictionary.get("CDM.ArgumentConfiguration.No_Value", args), Dictionary.get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 634 argument.setValue(null); 635 } 636 args = null; 637 return false; 638 } 639 argument.setAssigned(true); 639 640 return true; 640 641 }
Note:
See TracChangeset
for help on using the changeset viewer.