1 12 package org.eclipse.debug.internal.ui.actions.context; 13 14 import org.eclipse.core.runtime.IAdaptable; 15 import org.eclipse.debug.internal.ui.DebugPluginImages; 16 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 17 import org.eclipse.debug.internal.ui.actions.ActionMessages; 18 import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter; 19 import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor; 20 import org.eclipse.jface.resource.ImageDescriptor; 21 22 public class StepReturnAction extends StepIntoAction { 23 24 public ImageDescriptor getDisabledImageDescriptor() { 25 return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_RETURN); 26 } 27 28 public String getHelpContextId() { 29 return "step_return_action_context"; } 31 32 public ImageDescriptor getHoverImageDescriptor() { 33 return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN); 34 } 35 36 public String getId() { 37 return "org.eclipse.debug.ui.debugview.toolbar.stepReturn"; } 39 40 public ImageDescriptor getImageDescriptor() { 41 return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN); 42 } 43 44 public String getToolTipText() { 45 return ActionMessages.StepReturnAction_2; 46 } 47 48 public String getText() { 49 return ActionMessages.StepReturnAction_3; 50 } 51 52 53 protected void checkCapability(Object element, IBooleanRequestMonitor monitor) { 54 if (element instanceof IAdaptable) { 55 IAdaptable adaptable = (IAdaptable) element; 56 IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class); 57 if (steppy != null) { 58 steppy.canStepReturn(element, monitor); 59 } else { 60 notSupported(monitor); 61 } 62 } 63 } 64 65 protected void stepAction(Object element) { 66 if (element instanceof IAdaptable) { 67 IAdaptable adaptable = (IAdaptable) element; 68 IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class); 69 if (steppy != null) 70 steppy.stepReturn(element, new ActionRequestMonitor()); 71 } 72 } 73 74 protected String getStatusMessage() { 75 return ActionMessages.StepReturnActionDelegate_Exceptions_occurred_attempting_to_run_to_return_of_the_frame__2; 76 } 77 78 protected String getErrorDialogMessage() { 79 return ActionMessages.StepReturnActionDelegate_Run_to_return_failed__1; 80 } 81 } 82 | Popular Tags |