1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.action;
21
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24
25 import javax.help.CSH;
26 import javax.help.HelpBroker;
27 import javax.swing.AbstractAction;
28 import javax.swing.Action;
29
30 import org.xnap.XNap;
31 import org.xnap.gui.util.HelpManager;
32 import org.xnap.gui.util.IconHelper;
33
34 /***
35 * Provides an action that shows the about dialog.
36 */
37 public class ContextHelpAction extends AbstractAction
38 {
39
40
41
42
43
44
45
46 /***
47 * Constructs the ContextHelpAction.
48 */
49 public ContextHelpAction()
50 {
51 putValue(Action.NAME, XNap.tr("What's This?"));
52 putValue(IconHelper.XNAP_ICON, "contexthelp.png");
53 putValue(Action.SHORT_DESCRIPTION,
54 XNap.tr("Activates the context help mouse cursor."));
55
56 HelpBroker hb = HelpManager.getMainHelpBroker();
57 if (hb == null) {
58 setEnabled(false);
59 }
60 }
61
62
63
64 /***
65 * Delegates event to the <code>HelpManager.getTracker()</code>
66 * actionlistener.
67 */
68 public void actionPerformed(ActionEvent event)
69 {
70 ActionListener al = HelpManager.getTracker();
71 if (al != null) {
72 al.actionPerformed(event);
73 }
74 }
75 }