CloseWindow.java

Go to the documentation of this file.
00001 
00004 package edu.rice.cs.hpc.viewer.actions;
00005 
00006 
00007 import org.eclipse.core.commands.AbstractHandler;
00008 import org.eclipse.core.commands.ExecutionEvent;
00009 import org.eclipse.core.commands.ExecutionException;
00010 import org.eclipse.ui.IWorkbenchWindow;
00011 import org.eclipse.ui.handlers.HandlerUtil;
00012 
00013 import edu.rice.cs.hpc.viewer.window.ViewerWindowManager;
00014 
00015 
00020 public class CloseWindow extends AbstractHandler {
00021 
00022     /* (non-Javadoc)
00023      * @see org.eclipse.ui.commands.IHandler#execute(java.util.Map)
00024      */
00025     public Object execute(ExecutionEvent event) throws ExecutionException {
00026         final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
00027         // get an array of open databases for this window
00028         // do not remove the window yet right now
00029         // ViewerWindowManager.removeWindow(window);
00030         
00031         // close editor windows
00032         window.getActivePage().closeAllEditors(false);
00033         // close the workbench (which will close the application as well)
00034         window.close();
00035         
00036         ViewerWindowManager.removeWindow(window);
00037         
00038         return null;
00039     }
00040 
00041 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1