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 java.awt.event.KeyEvent;
24
25 import javax.swing.ImageIcon;
26 import javax.swing.KeyStroke;
27
28 import org.bounce.RunnableAction;
29 import org.xmlhammer.gui.XMLHammer;
30
31 /***
32 * An action that can be used to show Properties for a specific page.
33 *
34 * @version $Revision$, $Date$
35 * @author Edwin Dankert <edankert@gmail.com>
36 */
37 public class PageHelpAction extends RunnableAction {
38 private static final long serialVersionUID = 3258134648029526321L;
39
40 private XMLHammer parent = null;
41
42 /***
43 * The constructor for the action which shows Properties for a specific page.
44 *
45 * @param page the page the properties should be shown for.
46 */
47 public PageHelpAction(XMLHammer parent) {
48 super("Dynamic Help");
49
50 putValue(MNEMONIC_KEY, new Integer('D'));
51 putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0, false));
52 putValue(SHORT_DESCRIPTION, "Page specific help");
53 putValue(SMALL_ICON, new ImageIcon( getClass().getResource( "/org/xmlhammer/gui/icons/etool16/help.gif")));
54
55 this.parent = parent;
56 }
57
58 /***
59 * The implementation of the Page Properties action, called
60 * after a user action.
61 */
62 public void run() {
63 parent.showContextHelp();
64 }
65 }