DebugShowFlatID.java

Go to the documentation of this file.
00001 package edu.rice.cs.hpc.viewer.actions;
00002 
00003 import org.eclipse.core.commands.AbstractHandler;
00004 import org.eclipse.core.commands.ExecutionEvent;
00005 import org.eclipse.core.commands.ExecutionException;
00006 import org.eclipse.ui.IWorkbenchWindow;
00007 import org.eclipse.ui.commands.ICommandService;
00008 import org.eclipse.ui.handlers.HandlerUtil;
00009 
00010 /***
00011  * 
00012  * command class to show flat ID
00013  *
00014  */
00015 public class DebugShowFlatID extends AbstractHandler {
00016 
00017     static final public String commandId = "edu.rice.cs.hpc.viewer.command.debug.showFlatID";
00018 
00019     /*
00020      * (non-Javadoc)
00021      * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
00022      */
00023     public Object execute(ExecutionEvent event) throws ExecutionException {
00024         IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
00025 
00026         // toggle the debug mode
00027         HandlerUtil.toggleCommandState( event.getCommand() );
00028         
00029         final ICommandService commandService = (ICommandService) window.getService(ICommandService.class);
00030         commandService.refreshElements(commandId, null);
00031 
00032         return null;
00033     }
00034 
00035 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1