/**
* Creates an editor for the value of the selected environment variable.
*/
private void handleEnvEditButtonSelected() {
IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
if (var == null) {
return;
}
String originalName= var.getName();
String value= var.getValue();
MultipleInputDialog dialog= new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_11);
dialog.addTextField(NAME_LABEL, originalName, false);
dialog.addVariablesField(VALUE_LABEL, value, true);
if (dialog.open() != Window.OK) {
return;
}
String name= dialog.getStringValue(NAME_LABEL);
value= dialog.getStringValue(VALUE_LABEL);
if (!originalName.equals(name)) {
if (addVariable(new EnvironmentVariable(name, value))) {
environmentTable.remove(var);
}
} else {
var.setValue(value);
environmentTable.update(var, null);
updateLaunchConfigurationDialog();
}
}