summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2011-07-28 13:20:43 (EDT)
committer Steffen Pingel2011-07-28 14:21:35 (EDT)
commit1e29fc4431a1110fba182926c7080bc887ae978a (patch)
tree67d5b177152a74c81951b63f3c4d64d4809e8a9a
parent465cc7c89095dad7891d432b3c2a1280c627a064 (diff)
downloadorg.eclipse.mylyn.tasks-1e29fc4431a1110fba182926c7080bc887ae978a.zip
org.eclipse.mylyn.tasks-1e29fc4431a1110fba182926c7080bc887ae978a.tar.gz
org.eclipse.mylyn.tasks-1e29fc4431a1110fba182926c7080bc887ae978a.tar.bz2
NEW - bug 352918: [patch] Attribute editors generate duplicate change
event when task attribute changed https://bugs.eclipse.org/bugs/show_bug.cgi?id=352918
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
index 4c7ccac..49a6be8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
@@ -29,6 +29,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Steffen Pingel
+ * @author Sam Davis
* @since 3.0
*/
public abstract class AbstractAttributeEditor {
@@ -60,13 +61,18 @@ public abstract class AbstractAttributeEditor {
private String description;
+ private boolean refreshInProgress;
+
private final TaskDataModelListener modelListener = new TaskDataModelListener() {
@Override
public void attributeChanged(TaskDataModelEvent event) {
if (shouldAutoRefresh() && getTaskAttribute().equals(event.getTaskAttribute())) {
try {
+ refreshInProgress = true;
refresh();
} catch (UnsupportedOperationException e) {
+ } finally {
+ refreshInProgress = false;
}
}
}
@@ -96,7 +102,9 @@ public abstract class AbstractAttributeEditor {
* @since 3.0
*/
protected void attributeChanged() {
- getModel().attributeChanged(getTaskAttribute());
+ if (!refreshInProgress) {
+ getModel().attributeChanged(getTaskAttribute());
+ }
}
/**