Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 43464

Summary: [ViewMgmt] Eclipse usage model is too restrictive.
Product: [Eclipse Project] Platform Reporter: Philip Denno <pdenno>
Component: UIAssignee: Nick Edgar <n.a.edgar>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: ahunter.eclipse, ed.burnette, Matthew_Hatem
Version: 3.0   
Target Milestone: 3.1   
Hardware: All   
OS: All   
Whiteboard:

Description Philip Denno CLA 2003-09-22 17:17:56 EDT
While porting an application to work inside the eclipse shell I came across the
following problem which should be remidied ASAP.

My application creates a view with a data structure that shows a tree which the
user can modify by drag and drop or by context menus on the nodes in the tree.
When this tree is modified it needs to write a file out to disk. The current
behaviour of eclipse is at close or shutdown time it queries all open editors
and asks if they are dirty and if so it saves them, but for views it ignores them.

Now you could argue that the tree should be embedded in an editor. This is not
feasible because first it looks strange and provides a non-standard usage
pattern, and secondly because one of the main gains in the shell is that the
views are dockable, however when using editors they are only dockable within the
active editor pane.

This restriction forces developers to make many "hacks" to get the plugins to
work. For example, one could have an invisible editor associated with each view
and this editor would then act as a proxy to the view. Since making the editor
invisible requires the use of "internal classes" this is also not desirable.

The most desirable outcome would be for eclipse to call all the views during
shutdown as limiting this to editors only is an invalid assumption.
Comment 1 Ed Burnette CLA 2004-09-29 09:37:18 EDT
Wasn't this one fixed by allowing views to be saveable (see ISaveablePart and 
bug 45248)? Or another way to address it is allow editors to be dockable (see 
bug 52252 and bug 8886).
Comment 2 Nick Edgar CLA 2004-09-29 14:10:41 EDT
Views can be made saveable, and some improvements were made in bug 72114.
However the original complaint here has not been addressed.  When you shutdown
the workbench with views having unsaved changes, the user is not prompted to
save these changes.

Comment 3 Matthew Hatem CLA 2005-03-14 10:28:28 EST
Some questions:

1) For backward compatibility reasons, should this behavior only apply to views
that implement some new ISaveablePartXXX interface?

2) Should the save be batched in the same "save, don't save, cancel" dialog.

3) In bug #76768, I proposed a patch where an editor that implements the new
ISaveablePartXXX interface may provide some custom save prompt UI, in this case
each editor is brought to the front and the custom save prompt is presented to
the user.  Editors that behave this way are not batched in the dialog mentioned
above.  Supporting this behavior for Views will require that we switch
perspectives before shutdown.  Provided we preserve the "real" last opened
perspective, is switching perspectives reasonable?
Comment 4 Nick Edgar CLA 2005-03-14 15:25:39 EST
(1) No, I think we should treat this as an implementation bug.  Shutdown
handling should have been added originally when support for ISaveablePart for
views was added.

(2) I think that would suffice for the SDK scenarios for 3.1.

(3) Yes, switching is reasonable for the ISaveablePartXXX case, as long as we
oyt the workbench back in the same state as before the shutdown (modulo the
saves).  One downside is that this may trigger activation of previously
unactivated perspectives and views, causing more code loading and plug-in
activation, just before shutdown.
Comment 5 Nick Edgar CLA 2005-04-25 15:03:43 EDT
Closing as a dup of bug 84406, as the only missing functionality is prompt to
save on shutdown.


*** This bug has been marked as a duplicate of 84406 ***