Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-18 02:49:08 -0400
committerspingel2008-08-18 02:49:08 -0400
commit5ae90eb10c846583b58ecf00d7c9cf23424dce4b (patch)
treee4787cb16b2f52d3c5e56ef7340a3c2770a5b3a8
parent4966d6d26053841d6ae14313c00086c56f20a70e (diff)
downloadorg.eclipse.mylyn.tasks-5ae90eb10c846583b58ecf00d7c9cf23424dce4b.tar.gz
org.eclipse.mylyn.tasks-5ae90eb10c846583b58ecf00d7c9cf23424dce4b.tar.xz
org.eclipse.mylyn.tasks-5ae90eb10c846583b58ecf00d7c9cf23424dce4b.zip
RESOLVED - bug 242978: ensure consistent behavior for tasks that are not in the task list
https://bugs.eclipse.org/bugs/show_bug.cgi?id=242978
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java12
2 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
index cbd9a6b7c..0713510ea 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
@@ -388,6 +388,10 @@ public class TaskActivityManager implements ITaskActivityManager {
public void activateTask(ITask task) {
deactivateActiveTask();
+ if (taskList.getTask(task.getRepositoryUrl(), task.getTaskId()) == null) {
+ taskList.addTask(task, taskList.getDefaultCategory());
+ }
+
// notify that a task is about to be activated
for (ITaskActivationListener listener : new ArrayList<ITaskActivationListener>(activationListeners)) {
try {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index 1eaf99be5..4a48b7346 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -35,6 +35,7 @@ import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
+import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.ui.TaskTransfer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -598,7 +599,16 @@ public class TaskEditor extends SharedHeaderFormEditor {
// TODO EDITOR remove check
if (task != null) {
if (activateAction == null) {
- activateAction = new ToggleTaskActivationAction(task);
+ activateAction = new ToggleTaskActivationAction(task) {
+ @Override
+ public void run() {
+ TaskList taskList = TasksUiPlugin.getTaskList();
+ if (taskList.getTask(task.getRepositoryUrl(), task.getTaskId()) == null) {
+ setMessage("Task added to the Uncategorized container", IMessageProvider.INFORMATION);
+ }
+ super.run();
+ }
+ };
}
toolBarManager.add(new Separator("activation"));
toolBarManager.add(activateAction);

Back to the top