1 /*
2 * StartOctopusGeneratorAction.java. Created on Apr 23, 2004.
3 */
4 package org.webdocwf.util.loader.wizard;
5
6 import java.awt.Toolkit;
7 import java.awt.event.ActionEvent;
8
9 import javax.swing.AbstractAction;
10 import javax.swing.ImageIcon;
11 import javax.swing.KeyStroke;
12
13 /***
14 *
15 *
16 * @author Zoran Milakovic
17 */
18 public class StartOctopusGeneratorAction extends AbstractAction {
19
20 OctopusProjectFrame octopusProjectFrame;
21 /***
22 * This method starts the LoaderGenerator application
23 */
24 public StartOctopusGeneratorAction(OctopusProjectFrame octopusProjectFrame, String label) {
25 this.octopusProjectFrame = octopusProjectFrame;
26 putValue(NAME, label);
27 putValue(
28 SMALL_ICON,
29 new ImageIcon(
30 getClass().getClassLoader().getResource(
31 // "org/webdocwf/util/loader/" + "wizard/images/Play16.gif")));
32 "org/webdocwf/util/loader/" + "wizard/images/StartGenerator.gif")));
33 putValue(SHORT_DESCRIPTION, "Start the OctopusGenerator application");
34 putValue(LONG_DESCRIPTION, "Start the OctopusGenerator application");
35 putValue(
36 ACCELERATOR_KEY,
37 KeyStroke.getKeyStroke('G', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
38 putValue(MNEMONIC_KEY, new Integer('G'));
39 }
40
41 /***
42 * This method check if the action is performed (event key pressed)
43 * @param e is event
44 */
45 public void actionPerformed(ActionEvent e) {
46 OctopusGeneratorData initData = null;
47 String errorMsg = null;
48 try {
49 octopusProjectFrame.setActiveTab(0);
50 initData = octopusProjectFrame.getGeneratorPanel().getOctopusGeneratorInit();
51 octopusProjectFrame.getGeneratorPanel().getTraceArea().setText("");
52 OctopusGeneratorThread runGenerator =
53 new OctopusGeneratorThread(
54 initData,
55 errorMsg,
56 octopusProjectFrame.getGeneratorPanel().getTraceArea());
57 runGenerator.start();
58 } catch (Exception ex) {
59 errorMsg = ex.getMessage();
60 }
61 }
62
63 }
This page was automatically generated by Maven