if (oldValue == null && str.isEmpty()
|| String.valueOf(oldValue).equals(value)) {
return;
}
ParameterChangeValueCommand command = new ParameterChangeValueCommand(
model, "Change value");
Class<?> parameterType = model.getParameter((String) id)
.getType();
if (str.isEmpty()) {
// get default value
value = model.getParameter(parameterName).getDefault();
} else {
try {
if (parameterType == Integer.class) {
value = Integer.valueOf(str);
} else if (parameterType == Float.class) {
value = Float.valueOf(str);
} else if (parameterType == Boolean.class) {
if (!"true".equals(value) && !"false".equals(value)) {
throw new IllegalArgumentException();
}
value = Boolean.valueOf(str);
}
} catch (RuntimeException e) {
value = "invalid \"" + value + "\" value for "
+ parameterType.getSimpleName();
}
}
command.setValue(parameterName, value);
doRefresh = false;
((GraphEditor) part).executeCommand(command);
doRefresh = true;
}
} catch (PartInitException e) {