Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java12
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java12
4 files changed, 24 insertions, 25 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);
+ }
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index 106a4d786..80281fc5c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -457,15 +457,13 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
public void containersChanged(final Set<TaskContainerDelta> containers) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
- if (containers == null) {
- refresh(null);
- return;
- }
-
for (TaskContainerDelta taskContainerDelta : containers) {
if (taskContainerDelta.getContainer() instanceof AbstractTask) {
AbstractTask task = (AbstractTask)taskContainerDelta.getContainer();
switch (taskContainerDelta.getKind()) {
+ case ROOT:
+ refresh(null);
+ break;
case ADDED:
refresh(null);
break;
@@ -474,9 +472,13 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
break;
case CHANGED:
refresh(task);
+ break;
}
} else { // category or query
switch (taskContainerDelta.getKind()) {
+ case ROOT:
+ refresh(null);
+ break;
case ADDED:
refresh(null);
break;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
index 3fc8f744f..4783e7ba3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
@@ -22,13 +22,13 @@ import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.core.MylarStatusHandler;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.monitor.core.DateUtil;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.QueryHitCollector;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
+import org.eclipse.mylyn.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.ui.PlatformUI;
@@ -151,15 +151,7 @@ class SynchronizeQueryJob extends Job {
for (TaskRepository repository : repositories) {
TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository);
}
-
- // HACK: force entire Task List to refresh in case containers need to
- // appear or disappear
- TaskListView view = TaskListView.getFromActivePerspective();
- if (view != null) {
- // TODO: remove explicit refresh
- view.getViewer().refresh();
- }
-// taskList.notifyContainersUpdated(null);
+ taskList.notifyContainersUpdated(null);
monitor.done();

Back to the top