KickJava   Java API By Example, From Geeks To Geeks.

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


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 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 StepIntoAction extends StepAction {
23
24     /*
25      * (non-Javadoc)
26      * @see org.eclipse.debug.internal.ui.actions.context.StepAction#checkCapability(org.eclipse.debug.core.model.IStep, org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor)
27      */

28     protected void checkCapability(Object JavaDoc element, IBooleanRequestMonitor monitor) {
29         if (element instanceof IAdaptable) {
30             IAdaptable adaptable = (IAdaptable) element;
31             IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
32             if (steppy != null) {
33                 steppy.canStepInto(element, monitor);
34             } else {
35                 notSupported(monitor);
36             }
37         }
38     }
39
40     /*
41      * (non-Javadoc)
42      * @see org.eclipse.debug.internal.ui.actions.context.StepAction#stepAction(org.eclipse.debug.core.model.IStep)
43      */

44     protected void stepAction(Object JavaDoc element) {
45         if (element instanceof IAdaptable) {
46             IAdaptable adaptable = (IAdaptable) element;
47             IAsynchronousStepAdapter steppy = (IAsynchronousStepAdapter) adaptable.getAdapter(IAsynchronousStepAdapter.class);
48             if (steppy != null)
49                 steppy.stepInto(element, new ActionRequestMonitor());
50         }
51     }
52
53     /*
54      * (non-Javadoc)
55      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getStatusMessage()
56      */

57     protected String JavaDoc getStatusMessage() {
58         return ActionMessages.StepIntoActionDelegate_Exceptions_occurred_attempting_to_step_into_the_frame_2;
59     }
60
61     /*
62      * (non-Javadoc)
63      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getErrorDialogMessage()
64      */

65     protected String JavaDoc getErrorDialogMessage() {
66         return ActionMessages.StepIntoActionDelegate_Step_into_failed_1;
67     }
68
69     /*
70      * (non-Javadoc)
71      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getText()
72      */

73     public String JavaDoc getText() {
74         return ActionMessages.StepIntoAction_0;
75     }
76
77     /*
78      * (non-Javadoc)
79      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHelpContextId()
80      */

81     public String JavaDoc getHelpContextId() {
82         return "step_into_action_context"; //$NON-NLS-1$
83
}
84
85     /*
86      * (non-Javadoc)
87      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getId()
88      */

89     public String JavaDoc getId() {
90         return "org.eclipse.debug.ui.debugview.toolbar.stepInto"; //$NON-NLS-1$
91
}
92
93     /*
94      * (non-Javadoc)
95      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getToolTipText()
96      */

97     public String JavaDoc getToolTipText() {
98         return ActionMessages.StepIntoAction_3;
99     }
100
101     /*
102      * (non-Javadoc)
103      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getDisabledImageDescriptor()
104      */

105     public ImageDescriptor getDisabledImageDescriptor() {
106         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO);
107     }
108
109     /*
110      * (non-Javadoc)
111      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getHoverImageDescriptor()
112      */

113     public ImageDescriptor getHoverImageDescriptor() {
114         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
115     }
116
117     /*
118      * (non-Javadoc)
119      * @see org.eclipse.debug.internal.ui.actions.context.AbstractDebugContextAction#getImageDescriptor()
120      */

121     public ImageDescriptor getImageDescriptor() {
122         return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
123     }
124 }
125
Popular Tags