Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 274694 - [target] [editor] Target editor is dirty but can't save
Summary: [target] [editor] Target editor is dirty but can't save
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-01 16:27 EDT by Darin Wright CLA
Modified: 2009-05-07 14:32 EDT (History)
3 users (show)

See Also:
darin.eclipse: review+


Attachments
Patch (12.19 KB, patch)
2009-05-06 15:51 EDT, Ankur Sharma CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2009-05-01 16:27:43 EDT
I20090430-2300

If edit a target on the "Definition" tab, then go to the "Content" tab and back to the "Definition" tab, I can no longer save. The editor remains dirty and I lose my changes. Using either Ctrl-S or the File > Save action has no effect.
Comment 1 Ben Vitale CLA 2009-05-03 18:23:40 EDT
I'm seeing the same behavior.
Comment 2 Chris Aniszczyk CLA 2009-05-03 18:25:31 EDT
yap, me too. It's on the radar for RC1 ;)
Comment 3 Ankur Sharma CLA 2009-05-06 15:51:23 EDT
Created attachment 134686 [details]
Patch

Not the most elegent solution, but less invasive. Let me know if you don't like the approach.
Comment 4 Curtis Windatt CLA 2009-05-07 14:04:39 EDT
I agree that this is not the most elegant solution, but I wasn't able to come up with anything better.  Ankur's solution is actually pretty similar to what the PDEEditor framework does, just in a simpler way (since we don't have multiple input contexts).

The multi page editor framework is helpful enough to call commit() on a page when you switch to another one.  This marks the page as no longer being dirty (i.e. it has saved back to the model).  The editor's dirty state is intended to be separate from this (i.e. the model differs from the editor's file input).  We do not currently do this check and instead want the editor to be dirty if you touch anything.  Going forward we could consider other options that would check to see if the model's contents have actually changed from what's on disk.  But for RC1, Ankur's fix is good.

Darin, please verify.
Comment 5 Darin Wright CLA 2009-05-07 14:32:37 EDT
Verified. Works + low risk.