Bug 15691 - [Workbench] Sync prompts to save changes in unaffected projects
Summary: [Workbench] Sync prompts to save changes in unaffected projects
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo, usability
Depends on:
Blocks:
 
Reported: 2002-05-09 19:20 EDT by Nick Edgar CLA
Modified: 2009-08-30 02:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-05-09 19:20:31 EDT
Build 20020508

- had file open in project B
- sync'ed project A
- it prompted to save changes to the file

It should only prompt for the resources being sync'ed.
Comment 1 James Moody CLA 2002-05-13 13:45:16 EDT
We have no API to do this. We are calling IWorkbenchPage.saveAllEditors(), which
is consistent with the way that refactoring et al. prompt.

This won't be changed for M6.
Comment 2 Kevin McGuire CLA 2002-05-13 13:49:48 EDT
later, would require different API than what we have avail now
Comment 3 Michael Valenta CLA 2002-09-09 19:04:15 EDT
Reopening
Comment 4 Michael Valenta CLA 2002-09-17 16:09:17 EDT
The UI in question is providd by the UI component so moving to UI for comment.
Comment 5 Eduardo Pereira CLA 2002-09-18 09:21:29 EDT
Would the following API be enough?
    IWorkbench.getDirtyEditors() returning an IEditorPart[]
    IWorkbench.saveEditors(IEditorPart[],boolean confirm)

So you would call getDirtyEditors(), filter out the ones you do not care about 
and then call saveEditors().
Comment 6 Michael Valenta CLA 2002-09-18 09:27:03 EDT
As long as an IEditorPart adapts to the resource that is being edited, that API 
should be adequate.
Comment 7 Eduardo Pereira CLA 2002-10-08 10:31:25 EDT
No, IEditorPart do not adapt to IResource.
I am going to defer it for 3.0 if it is OK with you.

PS. We released API in IWorkbench to save all editors so you do not have to 
loop on all windows and pages. This means the user gets only one dialog instead 
of one for each window.
Comment 8 Eduardo Pereira CLA 2002-10-16 11:55:40 EDT
See bug 24841 and bug 24843.
Comment 9 Nick Edgar CLA 2002-10-24 13:53:46 EDT
Note that you can get the file for an editor by asking for the file or resource 
adapter on the editor's input:
editor.getEditorInput().getAdapter(IFile.class).

At least, that works for editors that use FileEditorInput.  If an editor has 
its own kind of input, there are no guarantees that it supports this (though it 
should if it's editing a resource).
Comment 10 Michael Valenta CLA 2002-10-24 14:13:06 EDT
If the above is true, then the API proposed by Eduardo should be adequate.
Comment 11 Tod Creasey CLA 2006-06-22 08:31:48 EDT
Is this still an issue in 3.2?
Comment 12 Nick Edgar CLA 2006-06-23 17:52:43 EDT
I seem to recall it still being an issue earlier in 3.2, but I just tried in RC5 and it seems better:

- modify file in project 1 without saving
- sync project 2
- no prompt
Comment 13 Denis Roy CLA 2009-08-30 02:11:27 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.