Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348969 - TaskDataModelListener not removed when attributes section not expanded
Summary: TaskDataModelListener not removed when attributes section not expanded
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.6.2   Edit
Assignee: Sam Davis CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2011-06-09 17:28 EDT by Sam Davis CLA
Modified: 2011-08-27 17:06 EDT (History)
1 user (show)

See Also:


Attachments
add listener only when the setControl is called (1.11 KB, patch)
2011-06-09 17:29 EDT, Sam Davis CLA
no flags Details | Diff
add listener only when the setControl is called (1.20 KB, patch)
2011-06-09 17:33 EDT, Sam Davis CLA
no flags Details | Diff
RichTextAttributeEditor patch (924 bytes, patch)
2011-06-09 21:16 EDT, Sam Davis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2011-06-09 17:28:49 EDT
When AbstractAttributeEditor is created, it adds a TaskDataModelListener to the TaskDataModel, and this listener is removed when the editor's control is disposed. However, if the attributes section is not expanded, the control is never created, and thus not diposed, so the model listener is never removed. This means that if you open a task editor without expanding the attributes section and repeatedly refresh it, you will add another model listener with every refresh.
Comment 1 Sam Davis CLA 2011-06-09 17:29:41 EDT
Created attachment 197745 [details]
add listener only when the setControl is called
Comment 2 Sam Davis CLA 2011-06-09 17:33:11 EDT
Created attachment 197746 [details]
add listener only when the setControl is called
Comment 3 Sam Davis CLA 2011-06-09 21:16:38 EDT
Created attachment 197748 [details]
RichTextAttributeEditor patch

When RichTextAttributeEditor is created, it calls RichTextEditor.setText() with the current value of its attribute. However, with the change above, if the attribute value changes before the control is created, this change will not be reflected in the control. This patch will call setText again when creating the control.
Comment 4 Steffen Pingel CLA 2011-08-26 13:24:57 EDT
Thanks Sam. Committed as 44ccf7a03a524bbe5f42214f127d9880b4d6b0a7 to e_3_7_m_3_6_x branch and master.
Comment 5 Steffen Pingel CLA 2011-08-27 17:06:19 EDT
Committed 995030b13e81646276a539a7c90d3077e9d1bd73 to address rendering problem with WikiText (e.g. bug 348237). The original patch did not have this problem, it was caused by me when reordering the refresh call.