KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > actions > context > StepOverAction


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  * Pawel Piech - bug 134177
11  *******************************************************************************/

12
13 package org.eclipse.debug.internal.ui.actions.context;
14
15 import org.eclipse.core.runtime.IAdaptable;
16 import org.eclipse.debug.internal.ui.DebugPluginImages;
17 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
18 import org.eclipse.debug.internal.ui.actions.ActionMessages;
19 import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepAdapter;
20 import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor;
21 import org.eclipse.jface.resource.ImageDescriptor;
22
23 public class StepOverAction extends StepIntoAction {
24     /*
25      * (non-Javadoc)
26      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getText()
27      */

28     public String JavaDoc getText() {
29         return ActionMessages.StepOverAction_0;
30     }
31
32     /*
33      * (non-Javadoc)
34      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getDisabledImageDescriptor()
35      */

36     public ImageDescriptor getDisabledImageDescriptor() {
37         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER);
38     }
39
40     /*
41      * (non-Javadoc)
42      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getHelpContextId()
43      */

44     public String JavaDoc getHelpContextId() {
45         return "step_over_action_context"; //$NON-NLS-1$
46
}
47
48     /*
49      * (non-Javadoc)
50      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getHoverImageDescriptor()
51      */

52     public ImageDescriptor getHoverImageDescriptor() {
53         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
54     }
55
56     /*
57      * (non-Javadoc)
58      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getId()
59      */

60     public String JavaDoc getId() {
61         return "org.eclipse.debug.ui.debugview.toolbar.stepOver"; //$NON-NLS-1$
62
}
63
64     /*
65      * (non-Javadoc)
66      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getImageDescriptor()
67      */

68     public ImageDescriptor getImageDescriptor() {
69         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
70     }
71
72     /*
73      * (non-Javadoc)
74      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getToolTipText()
75      */

76     public String JavaDoc getToolTipText() {
77         return ActionMessages.StepOverAction_3;
78     }
79
80     /*
81      * (non-Javadoc)
82      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#checkCapability(org.eclipse.debug.core.model.IStep, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
83      */

84     protected void checkCapability(Object JavaDoc element, IBooleanRequestMonitor monitor) {
85         if (element instanceof IAdaptable) {
86             IAdaptable adaptable = (IAdaptable) element;
87             IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
88             if (steppy != null) {
89                 steppy.canStepOver(element, monitor);
90             } else {
91                 notSupported(monitor);
92             }
93         }
94     }
95
96     /*
97      * (non-Javadoc)
98      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#stepAction(org.eclipse.debug.core.model.IStep)
99      */

100     protected void stepAction(Object JavaDoc element) {
101         if (element instanceof IAdaptable) {
102             IAdaptable adaptable = (IAdaptable) element;
103             IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
104             if (steppy != null)
105                 steppy.stepOver(element, new ActionRequestMonitor());
106         }
107     }
108
109     /*
110      * (non-Javadoc)
111      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getStatusMessage()
112      */

113     protected String JavaDoc getStatusMessage() {
114         return ActionMessages.StepOverActionDelegate_Exceptions_occurred_attempting_to_step_over_the_frame_2;
115     }
116
117     /*
118      * (non-Javadoc)
119      * @see org.eclipse.debug.internal.ui.actions.context.StepIntoAction#getErrorDialogMessage()
120      */

121     protected String JavaDoc getErrorDialogMessage() {
122         return ActionMessages.StepOverActionDelegate_Step_over_failed_1;
123     }
124 }
125
Popular Tags