Bug 208022

Summary: [Apply Patch] cancel save modified resource does not cancel apply patch
Product: [Eclipse Project] Platform Reporter: Benno Baumgartner <benno.baumgartner>
Component: CVSAssignee: platform-cvs-inbox <platform-cvs-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P5 CC: b.muskalla, Szymon.Brandys, tomasz.zarna
Version: 3.3Keywords: bugday, contributed
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard: hasPatch
Attachments:
Description Flags
utilize return value of saveEditors
none
mylyn/context/zip
none
Patch (API compatible) none

Description Benno Baumgartner CLA 2007-10-30 11:19:22 EDT
I20071029-1800

1. Make any compilation unit editor dirty
2. In the Package explorer select a project and invoke Team>Apply Patch...
3. Cancel the save resource dialog
Is:
 The apply patch dialog appears
Should:
 Cancel the apply patch operation, the is behavior is the one that should (and does) happen when selecting 'no'
Comment 1 Tomasz Zarna CLA 2007-11-06 09:16:11 EST
You're right Benno, I think we could add a similar dialog to the "Save Modified Resources" one, which you display prior refactoring i.e. a dialog with Ok/Cancel buttons only which would work as you suggested. Moreover, the "Save all modified resources automatically..." option is also a good example and we could use it too.
Comment 2 Tomasz Zarna CLA 2007-11-06 09:22:18 EST
Anyway, it's always a matter of how much time we would need to create a patch, but at least we should handle the "Cancel" button as you suggested (no Apply Patch dialog after hitting the button).
Comment 3 Benjamin Muskalla CLA 2008-02-27 17:48:06 EST
Created attachment 90943 [details]
utilize return value of saveEditors

Little patch to cancel the operation when canceling the save dialog
Comment 4 Benjamin Muskalla CLA 2008-02-27 17:48:10 EST
Created attachment 90944 [details]
mylyn/context/zip
Comment 5 Tomasz Zarna CLA 2008-02-29 07:40:29 EST
Created attachment 91169 [details]
Patch (API compatible)

Benjamin, your patch works fine but it breaks API compatibility (ie changing result type of an API method (including void) breaks compatibility). This is how we can acheive the same thing without breaking anything. What do you think?
Comment 6 Benjamin Muskalla CLA 2008-02-29 14:24:14 EST
hi Tomasz,

for sure. I don't know why but I had in mind the class was internal. Seems I was a little bit confused at that evening.
Go from me ;)
Comment 7 Tomasz Zarna CLA 2008-03-03 05:15:04 EST
The latest patch released to HEAD. Thanks Benjamin.
Comment 8 Tomasz Zarna CLA 2008-03-26 08:52:39 EDT
Verified in I20080304-1113.