summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2011-07-28 13:20:43 (EDT)
committerSteffen Pingel2011-07-28 13:20:43 (EDT)
commitc68c0975a0b613575a96faceb94adc8fd26e5afd (patch)
treec37d5d9cae3d0eabcdfd283fd15f9ded78181b4b
parent0389a642ac97ed9b379680424a0351039115cf47 (diff)
downloadorg.eclipse.mylyn.tasks-c68c0975a0b613575a96faceb94adc8fd26e5afd.zip
org.eclipse.mylyn.tasks-c68c0975a0b613575a96faceb94adc8fd26e5afd.tar.gz
org.eclipse.mylyn.tasks-c68c0975a0b613575a96faceb94adc8fd26e5afd.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());
+ }
}
/**