summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2011-08-26 13:15:45 (EDT)
committerSteffen Pingel2011-08-26 13:24:30 (EDT)
commita6e670eb0eec42de7e8bfe469dd5910f8305df87 (patch)
tree7235bed61ed2e30dd0cd6a1b0834e00db273b1dd
parentf8eb19c1bc0956b2067a93c2d6be68702ac8c806 (diff)
downloadorg.eclipse.mylyn.tasks-a6e670eb0eec42de7e8bfe469dd5910f8305df87.zip
org.eclipse.mylyn.tasks-a6e670eb0eec42de7e8bfe469dd5910f8305df87.tar.gz
org.eclipse.mylyn.tasks-a6e670eb0eec42de7e8bfe469dd5910f8305df87.tar.bz2
NEW - bug 348969: [patch] TaskDataModelListener not removed when
attributes section not expanded https://bugs.eclipse.org/bugs/show_bug.cgi?id=348969
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
index 9d774b9..a725a0d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
@@ -83,6 +83,9 @@ public class RichTextAttributeEditor extends AbstractAttributeEditor {
editor.createControl(parent, toolkit);
editor.getViewer().getTextWidget().setToolTipText(getDescription());
+ // refresh again, in case the value changed in the mean time
+ refresh();
+
setControl(editor.getControl());
}
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 49a6be8..0ba7b05 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
@@ -95,7 +95,6 @@ public abstract class AbstractAttributeEditor {
setDecorationEnabled(true);
setReadOnly(taskAttribute.getMetaData().isReadOnly());
setDescription(taskAttribute.getMetaData().getValue(TaskAttribute.META_DESCRIPTION));
- getModel().addModelListener(modelListener);
}
/**
@@ -199,11 +198,13 @@ public abstract class AbstractAttributeEditor {
protected void setControl(Control control) {
if (this.control != null && !this.control.isDisposed()) {
this.control.removeDisposeListener(disposeListener);
+ getModel().removeModelListener(modelListener);
}
this.control = control;
if (control != null) {
control.setData(KEY_TASK_ATTRIBUTE, taskAttribute);
control.addDisposeListener(disposeListener);
+ getModel().addModelListener(modelListener);
}
}