Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2010-08-19 16:29:57 -0400
committersminto2010-08-19 16:29:57 -0400
commitba847fa9a643a700e8d22f0960f5bc2ea0f2c056 (patch)
treedeaac3913357298031559aaecd4508c0d1f2ceee
parent318b8f39d3dd705cfa382e01f5d2831bb15d9922 (diff)
downloadorg.eclipse.mylyn.tasks-ba847fa9a643a700e8d22f0960f5bc2ea0f2c056.tar.gz
org.eclipse.mylyn.tasks-ba847fa9a643a700e8d22f0960f5bc2ea0f2c056.tar.xz
org.eclipse.mylyn.tasks-ba847fa9a643a700e8d22f0960f5bc2ea0f2c056.zip
NEW - bug 323190: tasks with shared due dates are not always correctly migrated
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323190
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskMigrator.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java22
2 files changed, 24 insertions, 8 deletions
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 379741f77..7f7cecf34 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
@@ -53,11 +53,17 @@ public class TaskMigrator {
private TaskEditor editor;
+ private boolean migrateDueDate = true;
+
public TaskMigrator(ITask oldTask) {
this.oldTask = oldTask;
this.openEditors = true;
}
+ public void setMigrateDueDate(boolean migrateDueDate) {
+ this.migrateDueDate = migrateDueDate;
+ }
+
public boolean openEditors() {
return openEditors;
}
@@ -180,7 +186,9 @@ public class TaskMigrator {
DateRange scheduledDate = ((AbstractTask) oldTask).getScheduledForDate();
TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) newTask, scheduledDate);
Date dueDate = ((AbstractTask) oldTask).getDueDate();
- TasksUiPlugin.getTaskActivityManager().setDueDate(newTask, dueDate);
+ if (migrateDueDate) {
+ TasksUiPlugin.getTaskActivityManager().setDueDate(newTask, dueDate);
+ }
((AbstractTask) newTask).setEstimatedTimeHours(((AbstractTask) oldTask).getEstimatedTimeHours());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index 9545a6f3c..13de3c18a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -92,10 +92,10 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
@@ -223,6 +223,8 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
TaskMigrator migrator = new TaskMigrator(oldTask);
migrator.setDelete(true);
migrator.setEditor(getTaskEditor());
+ migrator.setMigrateDueDate(!connector.hasRepositoryDueDate(getTaskRepository(),
+ newTask, taskData));
migrator.execute(newTask);
}
}
@@ -1291,15 +1293,21 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
if (part.getControl() != null) {
if (ID_PART_ACTIONS.equals(part.getPartId())) {
// do not expand horizontally
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(false, false).applyTo(
- part.getControl());
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL)
+ .grab(false, false)
+ .applyTo(part.getControl());
} else {
if (part.getExpandVertically()) {
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(
- part.getControl());
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL)
+ .grab(true, true)
+ .applyTo(part.getControl());
} else {
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(
- part.getControl());
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.TOP)
+ .grab(true, false)
+ .applyTo(part.getControl());
}
}
// for outline

Back to the top