/** * Displays this ID--HelpVisitListeners are notified. * * @param id a Map.ID indicating the URL to display * @exception InvalidHelpSetContextException if the current helpset does not contain * id.helpset */ public void setCurrentID(ID id) throws InvalidHelpSetContextException { debug("setCurrentID - ID"); createHelpModel(); model.setCurrentID(id); }
/** * Shows this ID as content relative to the (top) HelpSet for the Presentation * instance--HelpVisitListeners are notified. * * @param id A string that identifies the topic to show for the loaded (top) HelpSet * @exception BadIDException The ID is not valid for the HelpSet */ public void setCurrentID(String id) throws BadIDException { debug("setCurrentID - String"); try { setCurrentID(ID.create(id, helpset)); } catch (InvalidHelpSetContextException ex) { // this should not happen new Error("internal error?"); } }
/** * Show this ID. * * @param id a Map.ID indicating the URL to display * @param presentation The Presentation class to display the Help in. * @param presentationName The name of a Presentation section from a * HelpSet to use. For some Presentations this will also be * the name to apply to the Presentation. * @exception InvalidHelpSetContextException if the current helpset does not contain * id.helpset * @see Presentation */ public void showID(ID id, String presentation, String presentationName) throws InvalidHelpSetContextException { debug("showID - ID"); Presentation pres = getPresentation(presentation, presentationName); if (pres != null) { pres.setCurrentID(id); pres.setDisplayed(true); } }
/** * 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()); } } }
/** * Gets the font for this Presentation. */ public Font getFont () { debug("getFont"); return font; }
/** * Set the Presentation attributes from a named presentation in a HelpSet. * Extension of this class should extend this class by adding additional * attributes * * @params hsPres - the HelpSet.Presentation to retrieve the presentation * information from * * @see HelpSet.Presentation */ public void setHelpSetPresentation (HelpSet.Presentation hsPres) { debug("setHelpSetPresentation"); if (hsPres == null) { return; } // get the presentation size Dimension size = hsPres.getSize(); if (size != null) { setSize(size); } }
/** * Gets the font for this WindowPresentation */ public Font getFont() { debug("getFont"); Font font = super.getFont(); if (font == null) { if (jhelp == null) { createHelpWindow(); } return jhelp.getFont(); } return font; }
protected TextHelpModel getHelpModel () { if (model == null) { createHelpModel(); } return model; }
/** * Sets the font for this this WindowPresentation. * @param f The font. */ public void setFont (Font f) { debug("setFont"); super.setFont(f); if (jhelp != null && f != null) { jhelp.setFont(f); } }
/** * Requests the size of the presentation. * @returns Point the location of the presentation. */ public Dimension getSize() { debug("getSize"); // if the jhelp is created then just use the current sizes if (jhelp != null) { if (modallyActivated) { if (dialog != null) { return dialog.getSize(); } } else { if (frame != null) { return frame.getSize(); } } } return super.getSize(); }
/** * Shows this ID. * * @param id A string that identifies the topic to show for the loaded (top) HelpSet * @param presentation The Presentation class to display the Help in. * @param presentationName The name of a Presentation section from a * HelpSet to use. For some Presentations this will also be * the name to apply to the Presentation. * @exception BadIDException The ID is not valid for the HelpSet * @exception IllegalArgumentException if presentation is not valid * @see Presentation */ public void showID(String id, String presentation, String presentationName) throws BadIDException { debug("showID - string"); Presentation pres = getPresentation(presentation, presentationName); if (pres != null) { pres.setCurrentID(id); pres.setDisplayed(true); } }
/** * Sets the font for this this Presentation. Concrete implementations must * make sure that the font is properly set by extending this class. * @param f The font. */ public void setFont (Font f) { debug("setFont"); font = f; }
private synchronized void createJHelp() { debug ("createJHelp"); if (jhelp == null) { jhelp = new JHelp(getHelpModel(), null, getHelpSetPresentation()); Font font = super.getFont(); if (font != null) { jhelp.setFont(font); } Locale locale = getLocale(); if (locale != null) { jhelp.setLocale(locale); } jhelp.setToolbarDisplayed(toolbarDisplayed); jhelp.setNavigatorDisplayed(viewDisplayed); if (currentView != null) { JHelpNavigator nav = getNavigatorByName(currentView); if (nav != null) { jhelp.setCurrentNavigator(nav); } } if (titleFromDocument) { jhelp.getContentViewer(). addPropertyChangeListener("page", propertyChangeListener); } } }
hb.setDisplayed(true); } else { pres.setCurrentID(id); pres.setDisplayed(true);
/** * Returns the default HelpSet */ public HelpSet getHelpSet() { debug("getHelpSet"); return helpset; }
/** * sets the current URL. * HelpVisitListeners are notified. * The currentID changes if there is a mathing ID for this URL * @param url The url to display. A null URL is a valid url. */ public void setCurrentURL(URL url) { debug("setCurrentURL"); createHelpModel(); model.setCurrentURL(url); }
pres.setCurrentID(item.getID()); } catch (InvalidHelpSetContextException ex) { System.err.println("BadID: "+item.getID()); pres.setDisplayed(true);
/** * Requests the presentation be set to a given size. * Concrete implementation must override this method to properly set the * size. * * @param d - a Dimension to set the size to. */ public void setSize(Dimension d) { debug("setSize"); width = d.width; height = d.height; }
pres.setCurrentID(item.getID()); } catch (InvalidHelpSetContextException ex) { System.err.println("BadID: "+item.getID()); pres.setDisplayed(true);
/** * Sets the locale of this Presentation. The locale is propagated to * the presentation. Concrete implemenation must make sure they override * this class to properly set the locale. * * @param l The locale to become this component's locale. A null locale * is the same as the defaultLocale. * @see #getLocale */ public void setLocale(Locale l) { debug("setLocale"); locale = l; }