Changeset 9151
- Timestamp:
- 2005-02-23T14:07:26+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/ArgumentControl.java
r9139 r9151 59 59 protected JComponent value_control; 60 60 protected JCheckBox enabled; 61 61 62 public ArgumentControl(Argument argument, boolean enable, String value) { 62 63 super(); … … 197 198 } 198 199 200 public String getName() { 201 return argument.getName(); 202 } 203 204 public String getValue() { 205 String value = null; 206 if(value_control == null) { 207 // Flag value, nothing to do. 208 } 209 else if(value_control instanceof JTextField) { 210 value = ((JTextField)value_control).getText(); 211 } 212 else if(value_control instanceof JSpinner) { 213 value = ((JSpinner)value_control).getValue().toString(); 214 } 215 else if(value_control instanceof JComboBox) { 216 value = (((JComboBox)value_control).getSelectedItem()).toString(); 217 } 218 return value; 219 } 199 220 /** Retrieve the control used for storing values. 200 221 * @return JComponent … … 202 223 public JComponent getValueControl() { 203 224 return value_control; 225 } 226 227 public boolean isEnabled() { 228 if (enabled == null) { 229 return true; // always enabled 230 } 231 return enabled.isSelected(); 204 232 } 205 233 … … 278 306 String description = (String) arg_list.get(key); 279 307 if(description != null) { 280 description = Utility.formatHTMLWidth(DESCRIPTION_SEP + description, 60); 281 String original = source.getToolTipText(); 282 if(original == null) { 283 original = ""; 284 } 285 // Remove any existing extra description. 286 if(original.indexOf(DESCRIPTION_SEP) != -1) { 287 original = original.substring(0, original.indexOf(DESCRIPTION_SEP)); 288 } 289 source.setToolTipText(original + description); 308 description = Utility.formatHTMLWidth(description, 60); 309 source.setToolTipText(description); 290 310 } 291 311 }
Note:
See TracChangeset
for help on using the changeset viewer.