KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

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

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