@Override
public void widgetSelected(final SelectionEvent e) {
final String[] configurations = ConfigurationManager.getNodesConfig();
final Set<String> existingNames = new HashSet<String>(Arrays
.asList(configurations));
final InputDialog dialog = new ConfigurationSaveAsDialog(parent
.getShell(), "Save nodes configuration",
"Enter name for configuration:", nodesConfigName, existingNames);
if (dialog.open() == Window.OK) {
if (ConfigurationManager.saveNodesConfig(dialog.getValue())) {
nodesConfigName = dialog.getValue();
configNameLabel.setText(nodesConfigName);
} else {
final MessageBox messageBox = new MessageBox(parent.getShell(),
SWT.ICON_ERROR | SWT.OK);
messageBox.setMessage("Unable to save configuration: "
+ dialog.getValue());
messageBox.setText("Error");
messageBox.open();
}
}
}