AbstractObject model = getModel();
String dialogTitle = "New value";
String dialogMessage = "Please enter a value:";
String initialValue = "";
InputDialog dialog = new InputDialog(getShell(), dialogTitle,
dialogMessage, initialValue, new IInputValidator() {
@Override
public String isValid(String newText) {
return newText.isEmpty() ? "" : null;
}
});
if (dialog.open() == InputDialog.OK) {
List<Object> oldList = (List<Object>) model.getValue(parameterName);
List<Object> newList = new ArrayList<Object>(oldList);
newList.add(dialog.getValue());
IWorkbenchPart part = getPart();
if (part instanceof GraphEditor) {
ParameterChangeValueCommand command = new ParameterChangeValueCommand(
model, "Add element to list");