Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345909 - [regression] priority editor doesn't show new value
Summary: [regression] priority editor doesn't show new value
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 3.6   Edit
Assignee: Steffen Pingel CLA
QA Contact: Frank Becker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 343005
  Show dependency tree
 
Reported: 2011-05-16 06:32 EDT by Benjamin Muskalla CLA
Modified: 2011-05-17 19:40 EDT (History)
1 user (show)

See Also:


Attachments
fix (20.73 KB, patch)
2011-05-17 19:35 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 Benjamin Muskalla CLA 2011-05-16 06:32:44 EDT
Using Mylyn from HEAD of today

* open bugzilla task
* change priority
* the priority editor still shows the same value as before 
* submit works as expected
Comment 1 Steffen Pingel CLA 2011-05-16 13:13:50 EDT
Looks like a regression that was introduced by the changes for bug 343005.
Comment 2 Sam Davis CLA 2011-05-16 14:00:24 EDT
I am not seeing this problem.
Comment 3 Shawn Minto CLA 2011-05-16 14:37:20 EDT
Sam, I see this.  This happens if you change the value from the editor in the summary (the icon stays the same)
Comment 4 Sam Davis CLA 2011-05-16 15:55:27 EDT
After updating again, I now see the problem. I'll look into it now.
Comment 5 Sam Davis CLA 2011-05-16 16:02:06 EDT
Steffen, this is a result of the change you made on the parent bug:

(In reply to comment #10)
> I have committed a fix to ignores model events that were generated by the
> attribute editor itself.

I deliberately had put that mechanism in the subclasses that needed it rather than in AbstractAttributeEditor because I was afraid of introducing bugs like this. Maybe it would be better to undo your change and add it to whichever subclass I apparently missed. For which attribute editor did you see the problem?
Comment 6 Steffen Pingel CLA 2011-05-16 18:26:40 EDT
The problem is that the original patch on bug 343005 changed the behavior of PriortyAttributeEditor.setValue() which I missed when applying the patch. That caused the problem with updating of the priority editor.

(In reply to comment #5)
> I deliberately had put that mechanism in the subclasses that needed it rather
> than in AbstractAttributeEditor because I was afraid of introducing bugs like
> this. Maybe it would be better to undo your change and add it to whichever
> subclass I apparently missed. For which attribute editor did you see the
> problem?

The reason for the follow up patch is described on bug 343005 comment 8. 

You make a good point about the intended behavior of setValue() though. My thinking was that setValue() would update the value and control but given that it is not consistently implemented that way the proposed solution of looping through the event handler mechanism seems preferable. I'll take another review pass through the attribute editors to make sure we consistently filter refresh events that are triggered by editing controls.
Comment 7 Sam Davis CLA 2011-05-16 19:18:16 EDT
(In reply to comment #6)
> The problem is that the original patch on bug 343005 changed the behavior of
> PriortyAttributeEditor.setValue() which I missed when applying the patch. That
> caused the problem with updating of the priority editor.

Well, the change was just to remove the call to updateEditor which became unnecessary once it was auto-refreshing. PriortyAttributeEditor was working prior to the follow up patch which prevents that auto-refresh from occuring.

> 
> (In reply to comment #5)
> > I deliberately had put that mechanism in the subclasses that needed it rather
> > than in AbstractAttributeEditor because I was afraid of introducing bugs like
> > this. Maybe it would be better to undo your change and add it to whichever
> > subclass I apparently missed. For which attribute editor did you see the
> > problem?
> 
> The reason for the follow up patch is described on bug 343005 comment 8.

You didn't specify which attribute editor you saw the problem with though. For example, TextAttributeEditor does not have the problem you described because if filters the events it triggers.

> 
> You make a good point about the intended behavior of setValue() though. My
> thinking was that setValue() would update the value and control but given that
> it is not consistently implemented that way the proposed solution of looping
> through the event handler mechanism seems preferable. I'll take another review
> pass through the attribute editors to make sure we consistently filter refresh
> events that are triggered by editing controls.

Thanks!
Comment 8 Steffen Pingel CLA 2011-05-16 19:37:19 EDT
(In reply to comment #7)
> You didn't specify which attribute editor you saw the problem with though. For
> example, TextAttributeEditor does not have the problem you described because if
> filters the events it triggers.

Sorry, I should have been more specific. I saw that with the New Comment field which is implemented by RichTextAttributeEditor.
Comment 9 Sam Davis CLA 2011-05-16 19:44:55 EDT
Ah, I see the problem where undo works 1 character at a time for the new comment field as well as for text attribute editors, although I do not see the cursor jumping. Your change fixes the problem for both, but I don't understand why it fixes it for TextAttributeEditor, given that it should already be doing the same thing. So if you revert your change, I think it will break undo for TextAttributeEditor.
Comment 10 Steffen Pingel CLA 2011-05-17 19:35:36 EDT
Created attachment 195923 [details]
fix
Comment 11 Steffen Pingel CLA 2011-05-17 19:40:07 EDT
I have committed the patch which sets a suppressRefresh flag when attributes are edited to ignore refresh events for most attribute editors. Sam, I don't think this was necessarily a problem in TextAttributeEditor but SWT behavior can differ between platforms when values on controls are set programmatically. Some platforms generate modification events in that case but other don't.

Rob, Leo, Shawn, Sam, please watch for any oddities in regard to values not being correctly updated in the task editor as I have only tested the changes on Gtk so far. Thanks!