1 19 20 21 package ca.mcgill.sable.soot.cfg.actions; 22 23 import org.eclipse.gef.ui.actions.EditorPartAction; 24 import org.eclipse.ui.IEditorPart; 25 import ca.mcgill.sable.soot.*; 26 import soot.toolkits.graph.interaction.*; 27 import org.eclipse.jface.resource.*; 28 29 30 public class StepForwardAction extends EditorPartAction { 31 32 public static final String STEP_FORWARD = "step forward"; 33 36 public StepForwardAction(IEditorPart editor) { 37 super(editor); 38 setImageDescriptor(SootPlugin.getImageDescriptor("resume_co.gif")); 39 setToolTipText("Step Forward"); 40 } 41 42 43 46 protected boolean calculateEnabled() { 47 return true; 48 } 49 50 56 public void run(){ 57 if (SootPlugin.getDefault().getDataKeeper().inMiddle()){ 58 SootPlugin.getDefault().getDataKeeper().stepForward(); 59 } 60 else { 61 if (!InteractionHandler.v().doneCurrent()){ 62 InteractionHandler.v().setInteractionCon(); } 64 } 65 } 66 67 public void setEditorPart(IEditorPart part){ 68 super.setEditorPart(part); 69 } 70 71 protected void init() { 72 super.init(); 73 setId( STEP_FORWARD ); 74 } 75 } 76 | Popular Tags |