KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > actions > StepActionDelegate


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.actions;
12
13  
14
15 import org.eclipse.debug.core.DebugException;
16 import org.eclipse.debug.core.model.IStep;
17
18 public abstract class StepActionDelegate extends AbstractListenerActionDelegate {
19     
20     /**
21      * @see AbstractDebugActionDelegate#doAction(Object)
22      */

23     protected void doAction(Object JavaDoc object) throws DebugException {
24         if (object instanceof IStep) {
25             stepAction((IStep)object);
26         }
27     }
28     
29     /**
30      * @see AbstractDebugActionDelegate#isRunInBackground()
31      */

32     protected boolean isRunInBackground() {
33         return true;
34     }
35
36     /**
37      * @see AbstractDebugActionDelegate#isEnabledFor(Object)
38      */

39     protected boolean isEnabledFor(Object JavaDoc element) {
40         if (element instanceof IStep) {
41             return checkCapability((IStep)element);
42         }
43         return false;
44     }
45
46     /**
47      * Returns whether the <code>IStep</code> has the capability to perform the
48      * requested step action.
49      */

50     protected abstract boolean checkCapability(IStep element);
51
52     /**
53      * Performs the specific step action.
54      *
55      * @exception DebugException if the action fails
56      */

57     protected abstract void stepAction(IStep element) throws DebugException;
58 }
59
Popular Tags