KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.eclipse.debug.core.DebugException;
15 import org.eclipse.debug.core.model.ISuspendResume;
16
17 public class SuspendActionDelegate extends AbstractListenerActionDelegate {
18
19     /**
20      * @see AbstractDebugActionDelegate#doAction(Object)
21      */

22     protected void doAction(Object JavaDoc element) throws DebugException {
23         if (element instanceof ISuspendResume) {
24              ((ISuspendResume) element).suspend();
25         }
26     }
27     
28     /**
29      * @see AbstractDebugActionDelegate#isRunInBackground()
30      */

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

38     protected boolean isEnabledFor(Object JavaDoc element) {
39         return element instanceof ISuspendResume && ((ISuspendResume)element).canSuspend();
40     }
41
42     /**
43      * @see AbstractDebugActionDelegate#getStatusMessage()
44      */

45     protected String JavaDoc getStatusMessage() {
46         return ActionMessages.SuspendActionDelegate_Exceptions_occurred_attempting_to_suspend__2; //$NON-NLS-1$
47
}
48
49     /**
50      * @see AbstractDebugActionDelegate#getErrorDialogMessage()
51      */

52     protected String JavaDoc getErrorDialogMessage() {
53         return ActionMessages.SuspendActionDelegate_Suspend_failed_1; //$NON-NLS-1$
54
}
55
56 }
57
Popular Tags