use of org.netxms.ui.eclipse.serverconfig.dialogs.RerunTimeDialog in project netxms by netxms.
the class ScheduledTaskView method rescheduleTask.
/**
* Reschedule task
*/
protected void rescheduleTask() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
final ScheduledTask origin = (ScheduledTask) selection.toList().get(0);
final RerunTimeDialog dialog = new RerunTimeDialog(getSite().getShell(), origin.getExecutionTime());
if (dialog.open() != Window.OK)
return;
new ConsoleJob("Reschedule task", null, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
origin.setExecutionTime(dialog.getRerunDate());
origin.setFlags(origin.getFlags() & ~ScheduledTask.EXECUTED);
session.updateSchedule(origin);
}
@Override
protected String getErrorMessage() {
return "Cannot reschedule tasks";
}
}.start();
}
Aggregations