Community
Participate
Working Groups
See related PRs: 1GJW3AI: ITPVCM:WIN2000 - Compare with Stream Contents does not prompt for save changes. 1GFMRMH: ITPVCM:ALL - Project compare: edited files aren't marked We are having problems implementing prompt-for-save-on-close functionality in our compare editor. Doing this properly seems impossible given the current compare framework. If we get rid of our implementation of VCMCompareEditorInput.isSaveNeeded(), then the when we close the editor we get the following behaviour: 1. Editor says changes exist, do you want to save? (y/n/cancel) 2. User says "yes" 3. CompareEditor.doSave() first sends setInput(null) to each pane, then sends save() to the CompareEditorInput. BUT setInput(null) sent to each pane may cause additional prompting (changes exist, do you want to save? (y/n/cancel)) because, in ContentMergeViewer.inputChanged(), if fConfirmSave is true, the pane prompts for saving changes. We have no control over fConfirmSave, as it is a global setting. (Anyway, even if we did, we wouldn't turn it off because it is needed for the case that the user clicks on a different item in the tree). Why does this not happen in the normal (non-VCM) compare case? Because we enable the save actions in our editors, and in ContentMergeViewer.inputChanged(), the prompting only happens if the save actions are enabled. This code path needs to be fixed before we can prompt in this way. NOTES:
PRODUCT VERSION: 135
fixed for > 20020124. It should be possible to remove the implementation of VCMCompareEditorInput.isSaveNeeded(). When closing the editor the standard alert appears. If this alert is not dismissed all changes in the editor panes are saved, but their Save Alerts are not shown. I introduced an new method ContentMergeViewer.setConfirmSave (boolean).