use of org.netxms.ui.eclipse.actionmanager.dialogs.EditActionDlg in project netxms by netxms.
the class ActionManager method createAction.
/**
* Create new action
*/
private void createAction() {
final ServerAction action = new ServerAction(0);
final EditActionDlg dlg = new EditActionDlg(getSite().getShell(), action, true);
if (dlg.open() == Window.OK) {
new ConsoleJob(Messages.get().ActionManager_CreateJobName, this, Activator.PLUGIN_ID, Activator.PLUGIN_ID) {
@Override
protected String getErrorMessage() {
return Messages.get().ActionManager_CreateJobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
long id = session.createAction(action.getName());
action.setId(id);
session.modifyAction(action);
}
}.start();
}
}
use of org.netxms.ui.eclipse.actionmanager.dialogs.EditActionDlg in project netxms by netxms.
the class ActionManager method editAction.
/**
* Edit currently selected action
*/
private void editAction() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
final ServerAction action = (ServerAction) selection.getFirstElement();
final EditActionDlg dlg = new EditActionDlg(getSite().getShell(), action, false);
if (dlg.open() == Window.OK) {
new ConsoleJob(Messages.get().ActionManager_UpdateJobName, this, Activator.PLUGIN_ID, Activator.PLUGIN_ID) {
@Override
protected String getErrorMessage() {
return Messages.get().ActionManager_UpdateJobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.modifyAction(action);
}
}.start();
}
}
Aggregations