KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > util > loader > wizard > StartOctopusLoaderAction


1 /*
2  * StartOctopusLoaderAction.java. Created on Apr 23, 2004.
3  */

4 package org.webdocwf.util.loader.wizard;
5
6 import java.awt.Toolkit JavaDoc;
7 import java.awt.event.ActionEvent JavaDoc;
8
9 import javax.swing.AbstractAction JavaDoc;
10 import javax.swing.ImageIcon JavaDoc;
11 import javax.swing.KeyStroke JavaDoc;
12
13 /**
14  *
15  *
16  * @author Zoran Milakovic
17  */

18 public class StartOctopusLoaderAction extends AbstractAction JavaDoc {
19
20     OctopusProjectFrame octopusProjectFrame;
21
22     /**
23      * This method starts the LoaderGenerator application
24      */

25     public StartOctopusLoaderAction(OctopusProjectFrame octopusProjectFrame, String JavaDoc label) {
26         
27         this.octopusProjectFrame = octopusProjectFrame;
28         putValue(NAME, label);
29         putValue(
30             SMALL_ICON,
31             new ImageIcon JavaDoc(
32                 getClass().getClassLoader().getResource(
33 // "org/webdocwf/util/loader/" + "wizard/images/Play16.gif")));
34
"org/webdocwf/util/loader/" + "wizard/images/StartLoader.gif")));
35         putValue(SHORT_DESCRIPTION, "Start the OctopusLoader application");
36         putValue(LONG_DESCRIPTION, "Start the OctopusLoader application");
37         putValue(
38             ACCELERATOR_KEY,
39             KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
40         putValue(MNEMONIC_KEY, new Integer JavaDoc('L'));
41     }
42
43     /**
44      * This method check if the action is performed (event key pressed)
45      * @param e is event
46      */

47     public void actionPerformed(ActionEvent JavaDoc e) {
48         OctopusLoaderData initData = null;
49         String JavaDoc errorMsg = null;
50         try {
51             octopusProjectFrame.setActiveTab(1);
52             initData = octopusProjectFrame.getLoaderPanel().getOctopusLoaderInit();
53         } catch (Exception JavaDoc ex) {
54             ex.printStackTrace();
55             errorMsg = ex.getMessage();
56         }
57         octopusProjectFrame.getLoaderPanel().getTraceArea().setText("");
58         OctopusLoaderThread runOctopus = new OctopusLoaderThread(
59             initData,
60             errorMsg,
61             octopusProjectFrame.getLoaderPanel().getTraceArea());
62         runOctopus.start();
63     }
64
65 }
66
Popular Tags