summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-11-05 06:22:46 (EDT)
committerSteffen Pingel2011-11-05 06:22:46 (EDT)
commit149bc5e89936c44ccaa3080e919697db277c8a92 (patch)
tree19f8d3244e7901cb56cacf1cf85f67c7b036da06
parentc32f9d0154bdcb82f70615c15638e2ec56dcf0f1 (diff)
downloadorg.eclipse.mylyn.tasks-149bc5e89936c44ccaa3080e919697db277c8a92.zip
org.eclipse.mylyn.tasks-149bc5e89936c44ccaa3080e919697db277c8a92.tar.gz
org.eclipse.mylyn.tasks-149bc5e89936c44ccaa3080e919697db277c8a92.tar.bz2
NEW - bug 362352: [regression] copy context moves active time
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362352 Change-Id: Iea8c4b27f69277914e1b75cac2dd803c11d5ea1f
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/context/DefaultTaskContextStore.java18
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/CopyContextHandler.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java2
4 files changed, 25 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/context/DefaultTaskContextStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/context/DefaultTaskContextStore.java
index 394b42b..c35f23c 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/context/DefaultTaskContextStore.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/context/DefaultTaskContextStore.java
@@ -35,7 +35,7 @@ public class DefaultTaskContextStore extends AbstractTaskContextStore {
private File contextDirectory;
@Override
- public IAdaptable cloneContext(ITask sourceTask, ITask destinationTask) {
+ public IAdaptable copyContext(ITask sourceTask, ITask destinationTask) {
return null;
}
@@ -73,6 +73,17 @@ public class DefaultTaskContextStore extends AbstractTaskContextStore {
return file.exists();
}
+ @Override
+ public void mergeContext(ITask sourceTask, ITask targetTask) {
+ // ignore
+ }
+
+ @Override
+ public IAdaptable moveContext(ITask sourceTask, ITask destinationTask) {
+ // ignore
+ return null;
+ }
+
/**
* @since 3.7
*/
@@ -91,9 +102,4 @@ public class DefaultTaskContextStore extends AbstractTaskContextStore {
this.contextDirectory = directory;
}
- @Override
- public void mergeContext(ITask sourceTask, ITask targetTask) {
- // ignore
- }
-
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore.java
index 91b85bc..60d7bab 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/context/AbstractTaskContextStore.java
@@ -28,10 +28,19 @@ public abstract class AbstractTaskContextStore {
* Copies the context from <code>sourceTask</code> to <code>destinationTask</code>. Creates a new context if a
* <code>sourceTask</code> does not have a context.
*
- * @return result of the clone operation
+ * @return result of the copy operation
* @since 3.7
*/
- public abstract IAdaptable cloneContext(ITask sourceTask, ITask destinationTask);
+ public abstract IAdaptable copyContext(ITask sourceTask, ITask destinationTask);
+
+ /**
+ * Moves the context from <code>sourceTask</code> to <code>destinationTask</code>. Creates a new context if a
+ * <code>sourceTask</code> does not have a context.
+ *
+ * @return result of the move operation
+ * @since 3.7
+ */
+ public abstract IAdaptable moveContext(ITask sourceTask, ITask destinationTask);
/**
* @since 3.7
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/CopyContextHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/CopyContextHandler.java
index 8300d22..5a23fe6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/CopyContextHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/CopyContextHandler.java
@@ -79,7 +79,7 @@ public class CopyContextHandler extends AbstractTaskHandler {
switch (action) {
case REPLACE:
- IAdaptable context = TasksUiPlugin.getContextStore().cloneContext(sourceTask, targetTask);
+ IAdaptable context = TasksUiPlugin.getContextStore().copyContext(sourceTask, targetTask);
if (context == null) {
MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
TITLE_DIALOG, Messages.CopyContextHandler_SOURCE_TASK_DOES_HAVE_A_CONTEXT);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java
index 79b9f50..6cf7ff1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java
@@ -188,7 +188,7 @@ public class TaskMigrator {
}
// migrate context
- TasksUiPlugin.getContextStore().cloneContext(oldTask, newTask);
+ TasksUiPlugin.getContextStore().copyContext(oldTask, newTask);
}
public static boolean isActive() {