| Summary: | [View Mgmt] Save confirmation dialog pops up when close ISaveablePart view | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Amy Wu <for.work.things> |
| Component: | UI | Assignee: | Nick Edgar <n.a.edgar> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | ahunter.eclipse, dleroux, steven.wasleski |
| Version: | 3.0 | Keywords: | usability |
| Target Milestone: | 3.1 M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Amy Wu
Interesting use case. This argues for giving the view more explicit control over how/when saving is done, including possibly the prompt dialog, or at least the name shown. For bug 72114, I was hoping that we would be able to just get away with the change in behaviour, but that was apparently too optimistic. I should have stayed with my original, crusty, conservative outlook <g>. To do this properly, we'll have to define new API, which isn't possible at this point for 3.0.1. I'll add the preference as I originally suggested, with the default to give the 3.0 behaviour (no prompt). Actually, with the existing API, there's enough there to determine whether to save on close at all. See ISaveablePart.isSaveOnCloseNeeded(). That won't address the problem with using the view name though. The preference key along with the check for ISaveablePart.isSaveOnCloseNeeded () is a good enough fix for me for v3.0.1 (with the view name issue to be addressed later). Thanks for the quick response. So for now, the save on close dialog will not even pop up unless we have the preference key specified in the plugin_customization.ini right? Correct. Do you think this is something that RAD will likely use? Actually, I'm not familiar with anyone else in RAD using ISaveablePart except for me. So speaking for myself, for 3.0.1, I'd like to not use the dialog and so by not even specifying the preference key, everything should be fine. For a future release, I'd like to take better advantage of ISaveablePart and this confirmation dialog. For example, right now, I almost always have isDirty () return true, just so the Save action is always enabled. I'd like to improve my isDirty to more accuratly reflect whether or not a file is dirty in my view. And also for the confirmation dialog I would probably check first if my file is already opened in another editor, if so, I don't need the confirmation dialog. With the fix for 72114, isDirty() and isSaveOnCloseNeeded() should give you the flexibility you need, except for it using the view name in the prompt. Want to resolve this for 3.1. Dan, can you comment on your interest in this? This along with 60528 and 72144 are required to fix one of the biggest usability issues with RSM/RSA...I would suggest higher priority. OK. I've taken out the fix72114 preference check from Perspective.canCloseView().
So the code is now:
public boolean canCloseView(IViewPart view) {
if (view instanceof ISaveablePart) {
ISaveablePart saveable = (ISaveablePart)view;
if (saveable.isSaveOnCloseNeeded()) {
IWorkbenchWindow window = view.getSite().getWorkbenchWindow();
return SaveableHelper.savePart(saveable, view, window, true);
}
}
return true;
}
If the view doesn't want the prompt to save when dirty, it can return false for
isSaveOnCloseNeeded().
For customizing the appearance of the save on close prompt, see bug 76768.
For Save All support, and other ISaveablePart issues, see bug 84406.
Verified in I20040215-2300. |