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
00023
00024
00025 public Object execute(ExecutionEvent event) throws ExecutionException {
00026 final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
00027
00028
00029
00030
00031
00032 window.getActivePage().closeAllEditors(false);
00033
00034 window.close();
00035
00036 ViewerWindowManager.removeWindow(window);
00037
00038 return null;
00039 }
00040
00041 }