String strName = vectNameIndice.get(0);
String strIndice = vectNameIndice.get(1);
// getParameter whose name is strName
Parameter param = getParam(strName);
if (strIndice.equals(strInd)) {
// test if this component is a textfield
if (cp instanceof JTextField) {
JTextField tf = (JTextField) cp;
if (tf.getText().length() > 0) {
return param.getName() + "=" + tf.getText();
}
else {
return param.getName() + "=" + param.getDefaultValue();
}
}
else if (cp instanceof JComboBox) {
JComboBox cb = (JComboBox) cp;
if (cb.getSelectedItem() != null) {
return param.getName() + "=" + cb.getSelectedItem().toString();
}
else {
return param.getName() + "=" + param.getDefaultValue();
}
}
else if (cp instanceof JSpinner) {
JSpinner sp = (JSpinner) cp;
if (sp.getValue() != null) {
return param.getName() + "=" + sp.getValue().toString();
}
else {
return param.getName() + "=" + param.getDefaultValue();
}
}
else if (cp instanceof PnlFileChooser) {
PnlFileChooser pnl = (PnlFileChooser) cp;
if (pnl.getTextField().getText().length() > 0) {
return param.getName() + "=" + pnl.getTextField().getText();
}
else {
return param.getName() + "=" + param.getDefaultValue();
}
}
else if (cp instanceof JCheckBox) {
JCheckBox cb = (JCheckBox) cp;
Boolean bool = new Boolean(cb.isSelected());
return param.getName() + "=" + bool.toString();
}
}
}
}
return null;