KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > actions > HelpManual


1 /*
2  * Authors:
3  * Stefanovic Nenad chupo@iis.ns.ac.yu
4  * Bojanic Sasa sasaboy@neobee.net
5  *
6  */

7
8 package org.enhydra.jawe.actions;
9
10 import org.enhydra.jawe.*;
11 import org.enhydra.jawe.misc.*;
12
13 import java.io.*;
14 import java.awt.event.ActionEvent JavaDoc;
15 import java.net.URL JavaDoc;
16 import javax.help.*;
17
18 /**
19  * Class that realizes <B>help manual</B> action.
20  */

21 public class HelpManual extends ActionBase {
22
23    private HelpSet hs = null;
24    private HelpBroker hb = null;
25
26    public HelpManual (PackageEditor editor) {
27       super(editor);
28       createHelp();
29    }
30
31    public void actionPerformed(ActionEvent JavaDoc e) {
32       if (hb!=null) {
33          hb.setDisplayed(true);
34       }
35
36    }
37
38    public void createHelp() {
39       String JavaDoc defHelpSetName="Manual/jhelpset.hs";
40       PFLocale pfl=new PFLocale(ResourceManager.getChoosenLocale());
41       String JavaDoc helpSetName="Manual/jhelpset_"+pfl.getLocaleString()+".hs";
42       ClassLoader JavaDoc loader = getClass().getClassLoader();
43
44       try {
45          URL JavaDoc url = HelpSet.findHelpSet(loader,helpSetName);
46          if (url==null) {
47             url=HelpSet.findHelpSet(loader,defHelpSetName);
48          }
49          if (url != null) {
50             hs = new HelpSet(loader, url);
51          }
52       } catch (Exception JavaDoc ex) {
53          ex.printStackTrace();
54       }
55
56       if (hs!=null) {
57          hb = hs.createHelpBroker();
58       }
59    }
60
61 }
62
Popular Tags