Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343005 - [api] framework should provide facility to update attribute editors when the TaskDataModel changes
Summary: [api] framework should provide facility to update attribute editors when the ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.6   Edit
Assignee: Sam Davis CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
: 297545 (view as bug list)
Depends on: 345211 345212 345909
Blocks:
  Show dependency tree
 
Reported: 2011-04-15 13:52 EDT by Sam Davis CLA
Modified: 2011-05-19 11:04 EDT (History)
2 users (show)

See Also:


Attachments
proposed approach (2.49 KB, patch)
2011-04-15 13:55 EDT, Sam Davis CLA
no flags Details | Diff
mylyn/context/zip (1.91 KB, application/octet-stream)
2011-04-15 13:55 EDT, Sam Davis CLA
no flags Details
patch (38.03 KB, patch)
2011-05-05 15:00 EDT, Sam Davis CLA
no flags Details | Diff
mylyn/context/zip (5.30 KB, application/octet-stream)
2011-05-05 15:00 EDT, Sam Davis CLA
no flags Details
framework patch (22.84 KB, patch)
2011-05-09 18:04 EDT, Sam Davis CLA
steffen.pingel: iplog+
Details | Diff
fix (1.44 KB, patch)
2011-05-15 08:08 EDT, Steffen Pingel 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-04-15 13:52:33 EDT
I am working on a plugin which changes the values of various task attributes in response to user interaction in the task editor, and I would like the attribute editors to refresh with the new values. The problem is that most subclasses of AbstractAttributeEditor do not implement refresh(). Some of them do implement refresh() and provide their own TaskDataModelListener which calls refresh(), but it seems like this should be handled in the super class, and the listeners in the subclasses should be removed if they are not needed.
Comment 1 Sam Davis CLA 2011-04-15 13:55:57 EDT
Created attachment 193395 [details]
proposed approach

Steffen, here is what I'm thinking of doing. If this seems reasonable to you, I will make the subclasses implement refresh, remove unneeded listeners and submit a patch.
Comment 2 Sam Davis CLA 2011-04-15 13:55:59 EDT
Created attachment 193396 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2011-04-17 09:31:53 EDT
Agreed that the framework should invoke the refresh method. I'm not a big fan of a supportsRefresh() method but we may need it to maintain backwards compatibility.
Comment 4 Sam Davis CLA 2011-05-05 15:00:22 EDT
Created attachment 194863 [details]
patch

Steffen, here's a patch. This will update both the contents and options (where applicable) of the patched attribute editors. They are all pretty carefully tested.
Comment 5 Sam Davis CLA 2011-05-05 15:00:23 EDT
Created attachment 194864 [details]
mylyn/context/zip
Comment 6 Sam Davis CLA 2011-05-09 18:04:06 EDT
Created attachment 195156 [details]
framework patch

Here's the part of the patch for the framework.
Comment 7 Steffen Pingel CLA 2011-05-10 06:07:58 EDT
Thanks for the excellent patch, Sam! I have applied the changes to head. Only minor modification I made was to change shouldAutoRefresh() into a protected method. Let me know if there is a reason to make it public and we can reconsider.
Comment 8 Steffen Pingel CLA 2011-05-15 08:02:16 EDT
I discovered a problem that causes jumping of the cursor when entering text and broke undo.
Comment 9 Steffen Pingel CLA 2011-05-15 08:08:02 EDT
Created attachment 195662 [details]
fix
Comment 10 Steffen Pingel CLA 2011-05-15 08:08:42 EDT
I have committed a fix to ignores model events that were generated by the attribute editor itself.
Comment 11 Steffen Pingel CLA 2011-05-19 11:04:01 EDT
*** Bug 297545 has been marked as a duplicate of this bug. ***