use of org.netxms.ui.eclipse.serverconfig.dialogs.ScheduledTaskEditor in project netxms by netxms.
the class ScheduledTaskView method editTask.
/**
* Edit selected task
*/
protected void editTask() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
final ScheduledTask origin = (ScheduledTask) selection.toList().get(0);
new ConsoleJob("Update scheduled task", null, Activator.PLUGIN_ID, null) {
private ScheduledTask task = null;
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
final List<String> taskList = session.listScheduleCallbacks();
getDisplay().syncExec(new Runnable() {
@Override
public void run() {
ScheduledTaskEditor dialog = new ScheduledTaskEditor(getSite().getShell(), origin, taskList);
if (dialog.open() == Window.OK) {
task = dialog.getScheduledTask();
}
}
});
if (task != null)
session.updateSchedule(task);
}
@Override
protected String getErrorMessage() {
return "Cannot update scheduled tasks";
}
}.start();
}
Aggregations