}
- public void resetToDefault()
+
+ public void resetToDefault(boolean setDefaultParams)
{
enabled.setSelected(false);
- if (option.isRequired())
+ if (option.isRequired() || (setDefaultParams && option.getValue()!=null))
{
// Apply default value
selectOption(option, option.getValue());
initVal = (initEnabled) ? (String) val.getSelectedItem() : null;
}
}
-
+
}
public class ParamBox extends JPanel implements ChangeListener,
@SuppressWarnings("unchecked")
private void updateTable(WsParamSetI p, List<ArgumentI> jobArgset)
{
+ boolean setDefaultParams=false;
+ if (lastParmSet == null)
+ {
+ isUserPreset = false;
+ // First call - so provide Service default settings
+ setName.setSelectedItem(lastSetName = SVC_DEF);
+ }
+ if (p==null && SVC_DEF.equals(""+setName.getSelectedItem()))
+ {
+ // indicate that service defaults should be set if available
+ setDefaultParams=true;
+ }
// populate table from default parameter set.
List<ArgumentI> args = paramStore.getServiceParameters();
// split to params and required arguments
{
int cw = 0;
+ boolean optset=false;
for (ArgumentI myarg : args)
- {
+ {
// Ideally, Argument would implement isRequired !
if (myarg instanceof ParameterI)
{
{
OptionI opt = (OptionI) myarg;
OptionBox ob = opanp.addOption(opt);
- ob.resetToDefault();
+ ob.resetToDefault(setDefaultParams);
if (MAX_OPTWIDTH < ob.getPreferredSize().width)
{
MAX_OPTWIDTH = ob.getPreferredSize().width;
// TODO: check if args should be unselected prior to resetting using the
// preset
}
- else
- {
- if (lastParmSet == null)
- {
- isUserPreset = false;
- // first call - so create a dummy name
-
- setName.setSelectedItem(lastSetName = SVC_DEF);
- }
- }
if (jobArgset != null)
{