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

Bug 507302

Summary: Undoing in an AbstractFXEditor does not update dirty state
Product: [Tools] GEF Reporter: Victor Johnsson <victor.johnsson>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen, victor.johnsson
Version: unspecified   
Target Milestone: 5.0.0 (Oxygen) M4   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
a demonstration of the bug
none
editor implementation used to generate the bug none

Description Victor Johnsson CLA 2016-11-09 10:13:42 EST
Created attachment 265277 [details]
a demonstration of the bug

I made an editor using the GEF4 MVC Logo example by extending org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor. If an AbstractFXEditor is opened in a clean state and an undo is performed, the dirty state is not updated as can be seen in the attached gif.
Comment 1 Victor Johnsson CLA 2016-11-09 10:15:18 EST
Created attachment 265278 [details]
editor implementation used to generate the bug
Comment 2 Alexander Nyßen CLA 2016-11-09 13:35:06 EST
I pushed the following changes to origin/master:

- Introduced a markSaveLocation() operation that can be called when a save operation has been successfully completed.
- Revised dirty state computation to be based on the most recent dirty-state relevant operation that was executed.

With these adjustments, the dirty state is now handled differently. Within your client code, you will have to call markSaveLocation() from within doSave(IProgressMonitor) in case of success.
Comment 3 Alexander Nyßen CLA 2016-11-10 09:37:38 EST
I now further extracted an IDirtyStateProvider as a delegate, so things are not mixed within the AbstractFXEditor.
Comment 4 Alexander Nyßen CLA 2016-11-11 03:24:56 EST
Resolving this as fixed in 5.0.0 M4.