use of org.netxms.ui.eclipse.serverconfig.dialogs.VariableEditDialog in project netxms by netxms.
the class ServerConfigurationEditor method editVariable.
/**
* Edit currently selected variable
* @param var
*/
private void editVariable() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if ((selection == null) || (selection.size() != 1))
return;
final ServerVariable var = (ServerVariable) selection.getFirstElement();
final VariableEditDialog dlg = new VariableEditDialog(getSite().getShell(), var);
if (dlg.open() == Window.OK) {
new ConsoleJob(Messages.get().ServerConfigurationEditor_ModifyJobName, this, Activator.PLUGIN_ID, JOB_FAMILY) {
@Override
protected String getErrorMessage() {
return Messages.get().ServerConfigurationEditor_ModifyJobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.setServerVariable(dlg.getVarName(), dlg.getVarValue());
runInUIThread(new Runnable() {
@Override
public void run() {
refresh();
}
});
}
}.start();
}
}
Aggregations