Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Dong2016-05-19 20:11:51 +0000
committerGerrit Code Review @ Eclipse.org2016-06-08 18:38:38 +0000
commitee58f27b5dd6f493a23240024655e8d37293356d (patch)
treef28c5eb41307f594f80a785c02688d1aee04df9a /org.eclipse.mylyn.tasks.ui
parentc7b61a4748ba0ca0687fef5563165c01cfde0dc3 (diff)
downloadorg.eclipse.mylyn.tasks-ee58f27b5dd6f493a23240024655e8d37293356d.tar.gz
org.eclipse.mylyn.tasks-ee58f27b5dd6f493a23240024655e8d37293356d.tar.xz
org.eclipse.mylyn.tasks-ee58f27b5dd6f493a23240024655e8d37293356d.zip
494568: support refactoring task ids
Change-Id: I32f749d32f072bb05045e4749717309df8f4cb86 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=495066 Signed-off-by: Brandon Dong <brandon.dong@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation.java52
1 files changed, 4 insertions, 48 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation.java
index 95359f02f..e68466343 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListModifyOperation.java
@@ -11,68 +11,24 @@
package org.eclipse.mylyn.internal.tasks.ui;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
-import org.eclipse.mylyn.internal.tasks.core.TaskList;
+import org.eclipse.mylyn.internal.tasks.core.operations.TaskListOperation;
/**
* Use to perform atomic operations on the task list i.e. open/restore
- *
+ *
* @author Rob Elves
* @since 3.0
*/
-public abstract class TaskListModifyOperation implements IRunnableWithProgress {
-
- ISchedulingRule rule;
+public abstract class TaskListModifyOperation extends TaskListOperation implements IRunnableWithProgress {
public TaskListModifyOperation() {
this(null);
}
public TaskListModifyOperation(ISchedulingRule rule) {
- this.rule = rule;
+ super(rule, TasksUiPlugin.getTaskList());
}
- protected abstract void operations(IProgressMonitor monitor) throws CoreException, InvocationTargetException,
- InterruptedException;
-
- final public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- final InvocationTargetException[] ite = new InvocationTargetException[1];
- try {
- ITaskListRunnable runnable = new ITaskListRunnable() {
-
- public void execute(IProgressMonitor monitor) throws CoreException {
- try {
- Job.getJobManager().beginRule(rule, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- operations(monitor);
- } catch (InvocationTargetException e) {
- ite[0] = e;
- } catch (InterruptedException e) {
- throw new OperationCanceledException(e.getMessage());
- } finally {
- Job.getJobManager().endRule(rule);
- }
- }
- };
- getTaskList().run(runnable, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
-
- if (ite[0] != null) {
- throw ite[0];
- }
- }
-
- protected TaskList getTaskList() {
- return TasksUiPlugin.getTaskList();
- }
}

Back to the top