01: /*
02: * StopOctopusGeneratorAction.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 CloseOctopusProjectAction extends AbstractAction {
20:
21: OctopusProjectFrame octopusProjectFrame;
22:
23: /**
24: * This method stop the LoaderGenerator application
25: */
26: public CloseOctopusProjectAction(
27: OctopusProjectFrame octopusProjectFrame, String label) {
28:
29: this .octopusProjectFrame = octopusProjectFrame;
30: putValue(NAME, label);
31: putValue(SMALL_ICON, new ImageIcon(getClass().getClassLoader()
32: .getResource(
33: "org/webdocwf/util/loader/"
34: + "wizard/images/Stop.gif")));
35: putValue(SHORT_DESCRIPTION, "Close TDT project");
36: putValue(LONG_DESCRIPTION,
37: "Close Together Data Transformer project");
38: putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('E', Toolkit
39: .getDefaultToolkit().getMenuShortcutKeyMask()));
40: putValue(MNEMONIC_KEY, new Integer('E'));
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 e) {
48: if (JOptionPane.showConfirmDialog(octopusProjectFrame,
49: "Are you are sure want to close project?",
50: "Close project", JOptionPane.INFORMATION_MESSAGE) == 0) {
51: this.octopusProjectFrame.dispose();
52: }
53: }
54:
55: }
|