01: /*
02: * ShowHelpAction.java. Created on Apr 23, 2004.
03: */
04: package org.webdocwf.util.loader.wizard;
05:
06: import java.awt.Toolkit;
07: import java.awt.event.ActionEvent;
08:
09: import javax.swing.AbstractAction;
10: import javax.swing.ImageIcon;
11: import javax.swing.JOptionPane;
12: import javax.swing.KeyStroke;
13:
14: /**
15: *
16: *
17: * @author Zoran Milakovic
18: */
19: public class ShowHelpAction extends AbstractAction {
20:
21: /**
22: * Action which creates new help frame
23: */
24: public ShowHelpAction() {
25: putValue(NAME, "Help");
26: putValue(SMALL_ICON, new ImageIcon(getClass().getClassLoader()
27: .getResource(
28: "org/webdocwf/util/loader/"
29: + "wizard/images/Help16.gif")));
30: putValue(SHORT_DESCRIPTION, "Help for running the program");
31: putValue(LONG_DESCRIPTION, "Help for running the program");
32: putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('H', Toolkit
33: .getDefaultToolkit().getMenuShortcutKeyMask()));
34: putValue(MNEMONIC_KEY, new Integer('H'));
35: }
36:
37: /**
38: * Creating event for new windows help frame
39: * @param e is creating events
40: */
41: public void actionPerformed(ActionEvent e) {
42: try {
43: OctopusGeneratorHelpFrame helpFrame = new OctopusGeneratorHelpFrame();
44: helpFrame.setIconImage(new ImageIcon(getClass()
45: .getClassLoader().getResource(
46: "org/webdocwf/util/loader/"
47: + "wizard/images/Enhydra16.gif"))
48: .getImage());
49: helpFrame.setVisible(true);
50: } catch (Exception ex) {
51: String message = "Error while creating Help button : "
52: + ex.getMessage();
53: JOptionPane.showMessageDialog(null, message + "\n",
54: "Error", 0);
55: System.exit(0);
56: }
57: }
58:
59: }
|