Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-14 16:59:08 -0400
committermkersten2007-06-14 16:59:08 -0400
commitfe5d2f52d079fdd2e099f8956b3bbad7fab1191b (patch)
tree47b6e5acc096c87bd8b82e049d4cfe43c4ed3520 /org.eclipse.mylyn.tasks.core
parentbc31015f1e3ee0c4b8974a4a1d7949ec73b7e4b0 (diff)
downloadorg.eclipse.mylyn.tasks-fe5d2f52d079fdd2e099f8956b3bbad7fab1191b.tar.gz
org.eclipse.mylyn.tasks-fe5d2f52d079fdd2e099f8956b3bbad7fab1191b.tar.xz
org.eclipse.mylyn.tasks-fe5d2f52d079fdd2e099f8956b3bbad7fab1191b.zip
RESOLVED - bug 165880: [api] Listeners API should allow to pass multiple events in one call
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165880
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java23
2 files changed, 15 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
index 4a28f9672..999fdf3ea 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java
@@ -20,7 +20,7 @@ package org.eclipse.mylyn.tasks.core;
public final class TaskContainerDelta {
public enum Kind {
- ADDED, REMOVED, CHANGED
+ ADDED, REMOVED, CHANGED, ROOT
}
private final AbstractTaskContainer container;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
index c15b935c2..21d1376e2 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
@@ -616,15 +616,20 @@ public class TaskList {
}
public void notifyContainersUpdated(Set<? extends AbstractTaskContainer> containers) {
- Set<TaskContainerDelta> delta = new HashSet<TaskContainerDelta>();
- for (AbstractTaskContainer abstractTaskContainer : containers) {
- delta.add(new TaskContainerDelta(abstractTaskContainer, TaskContainerDelta.Kind.CHANGED));
- }
- for (ITaskListChangeListener listener : new ArrayList<ITaskListChangeListener>(changeListeners)) {
- try {
- listener.containersChanged(delta);
- } catch (Throwable t) {
- MylarStatusHandler.fail(t, "notification failed for: " + listener, false);
+ if (containers == null) {
+ Set<TaskContainerDelta> rootDelta = new HashSet<TaskContainerDelta>();
+ rootDelta.add(new TaskContainerDelta(null, TaskContainerDelta.Kind.ROOT));
+ } else {
+ Set<TaskContainerDelta> delta = new HashSet<TaskContainerDelta>();
+ for (AbstractTaskContainer abstractTaskContainer : containers) {
+ delta.add(new TaskContainerDelta(abstractTaskContainer, TaskContainerDelta.Kind.CHANGED));
+ }
+ for (ITaskListChangeListener listener : new ArrayList<ITaskListChangeListener>(changeListeners)) {
+ try {
+ listener.containersChanged(delta);
+ } catch (Throwable t) {
+ MylarStatusHandler.fail(t, "notification failed for: " + listener, false);
+ }
}
}
}

Back to the top