Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-05-25 18:03:17 -0400
committerspingel2010-05-25 18:03:17 -0400
commite2100aad0f0a594d36dbbf3cb515079c7d4a3ffa (patch)
tree9f48e6fe35995b6aeb63ab9f0b6404165c9fd13d /org.eclipse.mylyn.tasks.core
parent9fe99bd2583b510bba69e88468912254ecdb0ba4 (diff)
downloadorg.eclipse.mylyn.tasks-e2100aad0f0a594d36dbbf3cb515079c7d4a3ffa.tar.gz
org.eclipse.mylyn.tasks-e2100aad0f0a594d36dbbf3cb515079c7d4a3ffa.tar.xz
org.eclipse.mylyn.tasks-e2100aad0f0a594d36dbbf3cb515079c7d4a3ffa.zip
NEW - bug 308499: [api] add hook so that connectors can participate in task migration upon submission
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308499
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java13
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskMigrationEvent.java50
2 files changed, 63 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
index b330511c5..0080384e4 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
@@ -345,4 +345,17 @@ public abstract class AbstractRepositoryConnector {
*/
public abstract void updateTaskFromTaskData(TaskRepository taskRepository, ITask task, TaskData taskData);
+ /**
+ * Invoked when a task associated with this connector is migrated. This typically happens when an unsubmitted task
+ * is submitted to the repository. Implementers may override to implement custom migration rules.
+ * <p>
+ * Does nothing by default.
+ *
+ * @param event
+ * provides additional details
+ * @since 3.4
+ */
+ public void migrateTask(TaskMigrationEvent event) {
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskMigrationEvent.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskMigrationEvent.java
new file mode 100644
index 000000000..6e47e3d0e
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskMigrationEvent.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.core;
+
+/**
+ * Provides details about a task migration.
+ *
+ * @see AbstractRepositoryConnector#migrateTask(TaskMigrationEvent)
+ * @author Steffen Pingel
+ * @since 3.4
+ */
+public class TaskMigrationEvent {
+
+ private final ITask sourceTask;
+
+ private final ITask targetTask;
+
+ public TaskMigrationEvent(ITask sourceTask, ITask targetTask) {
+ this.sourceTask = sourceTask;
+ this.targetTask = targetTask;
+ }
+
+ /**
+ * Returns the source task of the migration.
+ *
+ * @see #getTargetTask()
+ */
+ public ITask getSourceTask() {
+ return sourceTask;
+ }
+
+ /**
+ * Returns the target task of the migration.
+ *
+ * @see #getSourceTask()
+ */
+ public ITask getTargetTask() {
+ return targetTask;
+ }
+
+}

Back to the top