Changeset 13158 for trunk/gli/src/org
- Timestamp:
- 2006-10-20T16:25:44+13:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 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() { -
trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataPrompt.java
r12735 r13158 208 208 if (argument.getName().equals("metadata_set")) { 209 209 argument.setType(Argument.METADATA_SET_NAMESPACE); 210 argument_control = new ArgumentControl(argument, true, "Exploded Metadata Set (exp)"); 210 211 } 211 // by default, all args are disabled, and no value 212 argument_control = new ArgumentControl(argument, false, null); 212 else { 213 // by default, all args are disabled, and no value 214 argument_control = new ArgumentControl(argument, false, null); 215 } 213 216 // make sure they are coloured the way we want - this is not the standard arg control coloring 214 217 argument_control.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
Note:
See TracChangeset
for help on using the changeset viewer.