}
public void run() {
final IInteractionContext context = (IInteractionContext) contexts.get(task);
final ITaskList taskList = TasksUiPlugin.getTaskList();
if (taskList.getTask(task.getRepositoryUrl(), task.getTaskId()) != null) {
boolean confirmed = MessageDialog.openConfirm(shell, TITLE_DIALOG, "The task '" + task.getSummary() + "' already exists. Do you want to override its context with the source?");
if (confirmed) {
Job job = new Job("Import context") {
protected IStatus run(IProgressMonitor monitor) {
((LocalContextStore) ContextCore.getContextStore()).importContext(context);
scheduleTaskActivationJob();
return Status.OK_STATUS;
}
};
job.schedule();
} else {
return;
}
} else {
Job job = new Job("Import task") {
protected IStatus run(IProgressMonitor monitor) {
((LocalContextStore) ContextCore.getContextStore()).importContext(context);
taskList.addTask(task);
scheduleTaskActivationJob();
return Status.OK_STATUS;
}
};
job.schedule();