this.getWorkbench().addWindowListener(new IWindowListener(){ public void windowClosed(IWorkbenchWindow arg0) { if(arg0.getWorkbench().isClosing()){ ...