Bug 113955 - [RCP] Allow regular plug-ins to veto shutdown
Summary: [RCP] Allow regular plug-ins to veto shutdown
Status: RESOLVED DUPLICATE of bug 71701
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-10-27 09:15 EDT by Christopher M. Judd CLA
Modified: 2006-01-11 11:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher M. Judd CLA 2005-10-27 09:15:55 EDT
Unless I am just unable to find it, there seems to be no good place to prevent 
the  Workbench from shutting down based on the state of a plug-in without 
extending and implementing a custom WorkbenchAdvisor. Similar to the 
functionality that prevents the Workbench from shutdown if an editor is unsaved 
and the user presses the cancel button. It would be helpful to have a means to 
register listeners that could also prevent shutdown without having to extend 
the WorkbenchAdvisor, expecially since the IDEWorkbenchAdvisor is internal.
Comment 1 Nick Edgar CLA 2005-10-27 10:21:50 EDT
We generally don't want to give arbitrary plug-ins this kind of power.
But please provide more details of your scenario.
Comment 2 Christopher M. Judd CLA 2005-10-27 11:44:14 EDT
We have a hierarchy of objects in memory that are displayed in a tree view and 
each object is editable via an associated editor. When the editor is saved it 
marks the object in memory dirty. Before the workbench is closed we want to be 
able to check if any objects are dirty and provide the opportunity to save or 
cancel (remain in the current workbench).

It is similar to the problem that RSM has with models and diagrams. RSM solves 
the problem by having a model editor that must be saved and if closed closes 
all of the diagrams. Having a seperate editor that represents our hierarchy in 
memory seems to be a little hocky since the only thing we want to be able to do 
is prompt for saving before they close the workbench.
Comment 3 Nick Edgar CLA 2006-01-11 11:52:31 EST
With the current support in 3.1, your view could implement ISaveablePart, and fire the appropriate dirty state change notifications.  The user would be prompted to save any changes on shutdown if the view reported that it was dirty, even if all editors were closed.  Does this solve the issue?
See also bug 112225.


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