KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Authors:
3  * Stefanovic Nenad chupo@iis.ns.ac.yu
4  * Bojanic Sasa sasaboy@neobee.net
5  * Puskas Vladimir vpuskas@eunet.yu
6  * Pilipovic Goran zboniek@uns.ac.yu
7  *
8  */

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

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