private void createHelpModel() { if (model == null) { model = new DefaultHelpModel(helpset); } }
/** * Changes the HelpSet for this broker. * @param hs The HelpSet to set for this broker. * A null hs is valid parameter. */ public void setHelpSet(HelpSet hs) { if (hs != null && helpset != hs) { model = new DefaultHelpModel(hs); helpset = hs; } }
/** * Create a JHelp with a JHelpContentViewer and all Navigators * requested in the HelpSet. * * @param hs The HelpSet. If hs is null the JHelp is created with a * TextHelpModel with no HelpSet. */ public JHelp(HelpSet hs) { this(new DefaultHelpModel(hs), null, hs==null? null : hs.getDefaultPresentation()); }
/** * 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"); // 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) { model = new DefaultHelpModel(hs); helpset = hs; } }
/** * Creates a JHelp with an instance of DefaultHelpModel as its data model. * * @param hs The HelpSet that provides context information. A null hs is valid * and creates a TextHelpModel with no HelpSet defined. */ public JHelpContentViewer(HelpSet hs) { super(); setModel(new DefaultHelpModel(hs)); updateUI(); }
/** * Creates a JHelp with a default TextHelpModel. */ public JHelpContentViewer() { super(); setModel(new DefaultHelpModel(null)); // no HelpSet here! updateUI(); }
/** * 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(); }
/** * Returns a JHelpNavigator with an instance of DefaultHelpModel as its * data model. * * @param view The NavigatorView to use. If <tt>view</tt> is null it creates a JHelpTOCNavigator * with a null NavigatorView. */ public JHelpNavigator(NavigatorView view) { super(); this.view = view; if (view != null) { setModel(new DefaultHelpModel(view.getHelpSet())); } else { setModel(null); } updateUI(); }
HelpModel newModel= new DefaultHelpModel(ehs); setModel((TextHelpModel)newModel); setupNavigators();