Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Is it possible to listen for a workbench to be closed by force?
Is it possible to listen for a workbench to be closed by force? [message #874938] Mon, 21 May 2012 20:36 Go to next message
Josh Davis is currently offline Josh DavisFriend
Messages: 20
Registered: August 2011
Junior Member
Previously in our 3.x code we would do this.
new IWorkbenchListener{
     @Override
        public boolean preShutdown(final IWorkbench workbench, final boolean forced) {           
            if (forced) {
                return true;
            }
            //Logic here to determine if we really want the workbench to close.
        }
}



I couldn't find a e4 workbench listener but I did find a IWindowCloseListener
new IWindowCloseHandler {
   @Override
   public boolean close(final MWindow window) {
       //Logic here to determine if we want the window to close.
   }
}


The only problem with the IWindowCloseListener is that I can't find a way to determine if the window is being forced closed. I would assume that if the workbench is being forced closed that the window would also be forced closed.

Is there a way to determine if the MWindow is being forced closed?
I checked the org.eclipse.e4.ui.workbench.IWorkbench API and it only has a run() and close() method. I didn't see any way to attach some sort listener to it that is comparable to the 3.x IWorkbenchListener, so that is why I converted from the Workbench to the MWindow.
Re: Is it possible to listen for a workbench to be closed by force? [message #880138 is a reply to message #874938] Fri, 01 June 2012 14:04 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

That's not available yet. There's still some work to do on the Eclipse4 lifecycle side.

PW


Previous Topic:Binding Contexts and Binding Tables
Next Topic:Project context menu
Goto Forum:
  


Current Time: Tue Apr 16 16:30:10 GMT 2024

Powered by FUDForum. Page generated in 0.98174 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top