1 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 ; 17 import java.net.URL ; 18 import javax.help.*; 19 20 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 e) { 34 if (hb!=null) { 35 hb.setDisplayed(true); 36 } 37 } 38 39 public void createHelp() { 40 String defHelpSetName="Tutorial/jhelpset.hs"; 41 PFLocale pfl=new PFLocale(ResourceManager.getChoosenLocale()); 42 String helpSetName="Tutorial/jhelpset_"+pfl.getLocaleString()+".hs"; 43 ClassLoader loader = getClass().getClassLoader(); 44 45 try { 46 URL 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 ex) { 54 ex.printStackTrace(); 55 } 56 57 if (hs!=null) { 58 hb = hs.createHelpBroker(); 59 } 60 } 61 62 } 63 | Popular Tags |