Community
Participate
Working Groups
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.
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.
Created attachment 193396 [details] mylyn/context/zip
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.
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.
Created attachment 194864 [details] mylyn/context/zip
Created attachment 195156 [details] framework patch Here's the part of the patch for the framework.
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.
I discovered a problem that causes jumping of the cursor when entering text and broke undo.
Created attachment 195662 [details] fix
I have committed a fix to ignores model events that were generated by the attribute editor itself.
*** Bug 297545 has been marked as a duplicate of this bug. ***