Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-05-07 20:11:44 -0400
committerspingel2011-05-07 20:11:44 -0400
commit295aeddab3f6cf43890010c03ec26c72b9758022 (patch)
tree6d19ae939cf0b3306635b1bd02404a0b0df622d0 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data
parent644fb694e2a59798867db525a93071b649f925fe (diff)
downloadorg.eclipse.mylyn.tasks-295aeddab3f6cf43890010c03ec26c72b9758022.tar.gz
org.eclipse.mylyn.tasks-295aeddab3f6cf43890010c03ec26c72b9758022.tar.xz
org.eclipse.mylyn.tasks-295aeddab3f6cf43890010c03ec26c72b9758022.zip
NEW - bug 343210: [patch][api] framework should provide facility to be notified when the TaskDataModel is refreshed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=343210
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java13
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModelListener.java9
2 files changed, 21 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
index 712c44d2c..4b398071f 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
@@ -177,6 +177,19 @@ public class TaskDataModel {
public void refresh(IProgressMonitor monitor) throws CoreException {
workingCopy.refresh(monitor);
+ if (this.listeners != null) {
+ for (final TaskDataModelListener listener : listeners) {
+ SafeRunner.run(new ISafeRunnable() {
+ public void handleException(Throwable e) {
+ StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Listener failed", e)); //$NON-NLS-1$
+ }
+
+ public void run() throws Exception {
+ listener.modelRefreshed();
+ }
+ });
+ }
+ }
}
public void removeModelListener(TaskDataModelListener listener) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModelListener.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModelListener.java
index adde25198..b173b188e 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModelListener.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModelListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * Copyright (c) 2008 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
@@ -13,6 +13,7 @@ package org.eclipse.mylyn.tasks.core.data;
/**
* @author Steffen Pingel
+ * @author Sam Davis
* @since 3.0
*/
public abstract class TaskDataModelListener {
@@ -22,4 +23,10 @@ public abstract class TaskDataModelListener {
*/
public abstract void attributeChanged(TaskDataModelEvent event);
+ /**
+ * @since 3.6
+ */
+ public void modelRefreshed() {
+ }
+
}

Back to the top