Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 54250 - SetPropertyValueCommand wrongly resets property on undo
Summary: SetPropertyValueCommand wrongly resets property on undo
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0.0 M9   Edit
Assignee: Pratik Shah CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 21756
Blocks:
  Show dependency tree
 
Reported: 2004-03-10 03:32 EST by Gunnar Wagenknecht CLA
Modified: 2011-05-17 21:58 EDT (History)
1 user (show)

See Also:


Attachments
Patch for SetPropertyValueCommand (2.53 KB, patch)
2004-03-10 03:34 EST, Gunnar Wagenknecht CLA
no flags Details | Diff
Patch for SetPropertyValueCommand using new API (2.42 KB, patch)
2004-05-03 13:34 EDT, Gunnar Wagenknecht CLA
wayne.beaton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2004-03-10 03:32:14 EST
This bug is caused by bug 21756.

It doesn't seem that this bug might be fixed in 3.0. We should have at least a 
workaround for it in GEF 2.1.3 and 3.0.

I will attach a patch against version 1.6 (current latest) which should be a 
proposed workaround.

Although I don't like workarounds it seems the only way to me to get this fixed 
in Eclipse GEF 2.1.3.
Comment 1 Gunnar Wagenknecht CLA 2004-03-10 03:34:21 EST
Created attachment 8450 [details]
Patch for SetPropertyValueCommand
Comment 2 Randy Hudson CLA 2004-03-10 10:58:06 EST
GEF 2.1.3 is completed.
As far as the workaround, i'm not very good at reading patches, but it looks 
like the suggestion is that we call isPropertySet() twice, once before setting 
it, and once after.  This sounds pretty simple.  Why so much code :-)? Again, 
maybe I'm misreading how a patch is generated.

-randy
Comment 3 Gunnar Wagenknecht CLA 2004-03-10 11:00:59 EST
Most of the code are comments. I don't like workaround so I comment a lot and 
don't remove old code but just comment it.
Comment 4 Gunnar Wagenknecht CLA 2004-04-30 12:02:47 EDT
This one is the GEF fix :) I reassigne the other one to get more feedback.
Comment 5 Gunnar Wagenknecht CLA 2004-05-03 13:34:17 EDT
Created attachment 10226 [details]
Patch for SetPropertyValueCommand using new API

This is the new patch using the new API. It also fixes the behavior if the new
API is not available yet by simple checking #isPropertySet twice (once before
and once after the new property value was set).
Comment 6 Pratik Shah CLA 2004-05-03 18:34:52 EDT
I have released the fix for this bug.  It does not use the IPropertySource2 
interface provided by Gunnar.  We'll wait and see if it makes it into the 
platform.

Gunnar, can you verify that this fix works?
Comment 7 Pratik Shah CLA 2004-05-05 14:20:06 EDT
Gunnar, please mark the bug as verified if the fix works.  Or reopen if you are 
still experiencing problems.

The fix should be in any build after 05/03.
Comment 8 Randy Hudson CLA 2004-05-05 15:11:34 EDT
Pratik, I fine-tuned the change so that we wouldn't hold onto the undo value 
unnecessarily.