Bug 2854

Summary: Compare: Save code path problematic (1GJYGAX)
Product: [Eclipse Project] Platform Reporter: James Moody <James_Moody>
Component: CompareAssignee: Andre Weinand <andre_weinand>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: All   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 197, 247    

Description James Moody CLA 2001-10-10 22:44:45 EDT
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:
Comment 1 DJ Houghton CLA 2001-10-29 19:21:36 EST
PRODUCT VERSION:

	135

Comment 2 Andre Weinand CLA 2002-01-25 13:02:34 EST
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).