KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > actions > StopActionDelegate


1 package com.bull.eclipse.jonas.actions;
2
3 /*
4  * (c) Copyright Bull SA 2003.
5  * All Rights Reserved.
6  */

7
8 import org.eclipse.jface.action.IAction;
9 import org.eclipse.jface.viewers.ISelection;
10 import org.eclipse.ui.IWorkbenchWindow;
11 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
12
13 import com.bull.eclipse.jonas.JonasLauncherPlugin;
14
15 public class StopActionDelegate implements IWorkbenchWindowActionDelegate {
16     private IWorkbenchWindow window;
17
18     /*
19      * @see IWorkbenchWindowActionDelegate#dispose()
20      */

21     public void dispose() {
22     }
23
24     /*
25      * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
26      */

27     public void init(IWorkbenchWindow window) {
28         this.window = window;
29     }
30
31     /*
32      * @see IActionDelegate#run(IAction)
33      */

34     public void run(IAction action) {
35         JonasLauncherPlugin.log(JonasLauncherPlugin.getResourceString("msg.stop"));
36
37         try {
38             JonasLauncherPlugin.getDefault().getJonasBootstrap().stop();
39         } catch (Exception JavaDoc ex) {
40             String JavaDoc msg = JonasLauncherPlugin.getResourceString("msg.stop.failed");
41             JonasLauncherPlugin.log(msg + "/n");
42             JonasLauncherPlugin.log(ex);
43         }
44     }
45
46     /*
47      * @see IActionDelegate#selectionChanged(IAction, ISelection)
48      */

49     public void selectionChanged(IAction action, ISelection selection) {
50     }
51
52 }
53
54
Popular Tags