/** * Set the URL to the HelpSet. This forces the HelpSet to be reloaded. * * @param spec Where to locate the HelpSet. A null spec is valid */ public void setHelpSetSpec(String spec) { URL url; HelpSet hs; ClassLoader loader = this.getClass().getClassLoader(); try { url = new URL(spec); hs = new HelpSet(loader, url); } catch (Exception ex) { System.err.println("Trouble setting HelpSetSpec to spec |"+spec+"|"); System.err.println(" ex: "+ex); hs = null; } contentViewer.setModel(new DefaultHelpModel(hs)); setModel(contentViewer.getModel()); updateUI(); }
/** * Create a JHelp using the TextHelpModel and HelpHistoryModel * * @param model A model to use for the content and all the navigators. If <tt>model</tt> * is null it is the same as creating without a TextHelpModel * @param history A history model. If <<tt>history</tt> is null it is the same * as creating without HelpHistoryModel */ public JHelp(TextHelpModel model, HelpHistoryModel history, HelpSet.Presentation hsPres){ super(); if(history == null) this.historyModel = new DefaultHelpHistoryModel(this); else this.historyModel = history; this.hsPres = hsPres; navigators = new Vector(); navDisplayed = true; // HERE -- need to do something about doc title changes.... this.contentViewer = new JHelpContentViewer(model); setModel(model); if (model != null) { setupNavigators(); } updateUI(); }
/** * Changes the HelpSet for this presentation. * @param hs The HelpSet to set for this presentation. * A null hs is valid parameter. */ public void setHelpSet(HelpSet hs) { debug("setHelpSet"); HelpSet helpset = super.getHelpSet(); // If we already have a model check if the HelpSet has changed. // If so change the model // This could be made smarter to cache the helpmodels per HelpSet if (hs != null && helpset != hs) { super.setHelpSet(hs); if (jhelp != null) { jhelp.setModel(super.getHelpModel()); } } }
debug("master helpset without navigators"); HelpModel newModel= new DefaultHelpModel(ehs); setModel((TextHelpModel)newModel); setupNavigators(); return;