Community
Participate
Working Groups
(I was advised by PW in Bug #405562 to open a new bug report, so here it is.) The behaviour is exactly as that described in Bug #3772992, this time caused by a regression introduced (I think) by the fix for Bug #405562. A 3.8 based RCP app is running in E4 RC4. Build id: I20130605-2000 with the "compatibility" layer. I have Editor parts that sub-class EditorPart. I over-ride isSaveOnCloseNeeded() to return false so that the "<resource> has been modified. Save changes?" dialog is *not* shown by the workbench if the editor is dirty and the user manually closes the editor part. However, isSaveOnCloseNeeded() is not called and the dialog is shown. This works when using Ctrl+W but not when clicking on the 'X'.
Correction: the original was Bug #372992.
This seems to fail for the tab close because our Eclipse4 closePart->savePart lets the save run without considering that it was called from a close, and our org.eclipse.e4.ui.workbench.modeling.ISaveHandler (which is pluggable from the Workbench layer that knows about ISaveablePart) cuts the algorithm after the knowledge that this is a close has already been lost. For the Workbench/3.x RCP case, solving Bug 396318 should fix this problem for tabs as well, as ClosePartHandler will go through the Workbench closeEditor(*) or hideView(*). Paul E, what do you think? For views instead of editors, I've already released http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f8df51502b1c801fd23198ad34123f0994633ce7 PW
(In reply to comment #0) > A 3.8 based RCP app is running in E4 RC4. Build id: I20130605-2000 with the > "compatibility" layer. > > I have Editor parts that sub-class EditorPart. I over-ride > isSaveOnCloseNeeded() to return false so that the "<resource> has been > modified. Save changes?" dialog is *not* shown by the workbench if the > editor is dirty and the user manually closes the editor part. > > However, isSaveOnCloseNeeded() is not called and the dialog is shown. > > This works when using Ctrl+W but not when clicking on the 'X'. The same is true for our own editors.
Proposed fixed pushed to Gerrit (on master/4.4) for review: https://git.eclipse.org/r/18398
(In reply to Paul Elder from comment #4) > Proposed fixed pushed to Gerrit (on master/4.4) for review: > > https://git.eclipse.org/r/18398 Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2a663db0ec8b5526b9ed1c61e6a793b495110234 and backported as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_3_maintenance&id=eb411f692ec4e08f41bd3e0df84d06810b39ede8 PW
Verified in build 4.3.0.M20131127-1300