1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.xmlhammer.gui.actions;
22
23 import javax.swing.ImageIcon;
24 import javax.swing.JFrame;
25
26 import org.bounce.RunnableAction;
27 import org.xmlhammer.gui.AboutDialog;
28
29 /***
30 * An action that can be used to show the about dialog.
31 *
32 * @version $Revision$, $Date$
33 * @author Edwin Dankert <edankert@cladonia.com>
34 */
35 public class ShowAboutDialogAction extends RunnableAction {
36 private static final long serialVersionUID = 9190238043527858641L;
37
38 private AboutDialog dialog = null;
39
40 /***
41 * The constructor for the action which shows
42 * the about dialog.
43 *
44 * @param frame the parent frame.
45 */
46 public ShowAboutDialogAction(JFrame frame) {
47 super( "About XML Hammer");
48
49 putValue(MNEMONIC_KEY, new Integer('A'));
50 putValue(SMALL_ICON, new ImageIcon(getClass().getResource( "/toolbarButtonGraphics/general/About16.gif")));
51 putValue(SHORT_DESCRIPTION, "About XML Hammer");
52
53 dialog = new AboutDialog(frame);
54 }
55
56 /***
57 * The implementation of the action that shows the about dialog,
58 * called after a user action.
59 */
60 @Override
61 public void run() {
62 dialog.setLocationRelativeTo( dialog.getOwner());
63 dialog.setVisible( true);
64 }
65 }