try
{
args = p.getArguments(serviceOptions);
- // quick test of getArguments
- for (Object rg: p.getOptions())
- {
- String _rg = ((String) rg).substring(1);// remove initial arg character -
- String _rgv = _rg;
- // select arg name
- int _rgs = _rg.indexOf(" ");
- if (_rgs>0)
- {
- _rgv = _rg.substring(_rgs+1);
- _rg = _rg.substring(0,_rgs);
- }
- boolean found=false;
- for (Argument ar:args)
- {
- if (ar.getName().equalsIgnoreCase(_rg) || ar.getDefaultValue()!=null && ar.getDefaultValue().equalsIgnoreCase(_rgv))
- {
- found = true;
- continue;
- }
- }
- if (!found)
- {
- System.err.println("Couldn't set Argument: "+rg.toString());
- }
- }
} catch (Exception e)
{
e.printStackTrace();
}
if (string == null)
{
- // no value specified.
+ // no value specified. Either a ..
+// if (opt.getPossibleValues()==null || opt.getPossibleValues().size()<=1) {
+ // switch
+// cb.enabled.setSelected(true);
+// } else {
+// // or unselected option
+// cb.enabled.setSelected(false);
+// }
if (opt.isRequired())
{
// indicate option needs to be selected!
}
}
+ if (opt.isRequired() && !cb.enabled.isSelected())
+ {
+ // TODO: indicate paramset is not valid.. option needs to be selected!
+ }
cb.setInitialValue();
}