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