Community
Participate
Working Groups
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.
We generally don't want to give arbitrary plug-ins this kind of power. But please provide more details of your scenario.
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.
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 ***