- Timestamp:
- 2006-10-20T16:25:44+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentControl.java
r12829 r13158 178 178 } 179 179 } 180 181 selectValue((JComboBox) value_control, initial_value); 182 180 183 } // end of switch 181 184 … … 458 461 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.Argument.ArgumentOption 459 462 */ 460 public static boolean selectValue(JComboBox combobox, String target) {461 ///ystem.err.println("Searching for the target string: " + target); 462 for (int i = 0; i < combobox.getItemCount(); i++) {463 public static boolean selectValue(JComboBox combobox, String target) 464 { 465 for (int i = 0; i < combobox.getItemCount(); i++) { 463 466 Object object = combobox.getItemAt(i); 464 if(object instanceof Argument.ArgumentOption) { 467 468 if (object instanceof Argument.ArgumentOption) { 465 469 Argument.ArgumentOption opt = (Argument.ArgumentOption) object; 466 ///ystem.err.print("/tChecking: " + lo.getValue() + "... "); 467 if(opt.name.startsWith(target)) { 468 ///ystem.err.println("Match!"); 470 if (opt.name.startsWith(target)) { 469 471 combobox.setSelectedIndex(i); 470 472 combobox.setToolTipText(opt.getToolTip()); 471 473 return true; 472 474 } 473 /*474 else {475 System.err.println("No Match.");476 }477 */478 475 } 479 476 else if (object instanceof MetadataElement) { … … 483 480 } 484 481 } 485 } 482 else if (object.toString().equals(target)) { 483 combobox.setSelectedIndex(i); 484 return true; 485 } 486 } 487 486 488 return false; 487 489 } 490 491 488 492 /** Forces the control into an 'enabled' mode. */ 489 493 public void setEnabled() {
Note:
See TracChangeset
for help on using the changeset viewer.