Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352918

Summary: attribute editors generate duplicate change event when task attribute changed
Product: z_Archived Reporter: Sam Davis <sam.davis>
Component: MylynAssignee: Sam Davis <sam.davis>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 Keywords: contributed
Version: unspecifiedFlags: steffen.pingel: juno+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 350561    
Attachments:
Description Flags
fix none

Description Sam Davis CLA 2011-07-22 17:43:36 EDT
When TextAttributeEditor or RichTextAttributeEditor are refresh()ed, they call attributeChanged. I'm not sure if any other attribute editors have this problem.
Comment 1 Sam Davis CLA 2011-07-22 17:47:51 EDT
Created attachment 200228 [details]
fix

This should fix it, unless there are any attribute editors that have this problem and call attributeChanged directly on the model.
Comment 2 Steffen Pingel CLA 2011-07-27 18:33:05 EDT
Thanks. We should fix this. Would you be able to include a test case?
Comment 3 Steffen Pingel CLA 2011-07-28 13:31:21 EDT
Attribute editors should not be invoking attributeChanged() unless a user interaction happens. TextAttributeEditor or RichTextAttributeEditor guard against that but LongTextEditor does not which caused bug 350561.

To fix it I have applied the patch to the master and e_3_7_m_3_6_x branches: c68c0975a0b613575a96faceb94adc8fd26e5afd. 

Thanks for looking into this Sam. Apparently, the previous API contract was too brittle (considering that the framework did not observe it correctly) and your patch helps to make this more robust and simpler to implement for clients.
Comment 4 Steffen Pingel CLA 2011-07-28 14:33:04 EDT
Marking resolved.