/** * @return The URL to the HelpSet. */ public URL getHelpSetURL() { HelpSet hs = contentViewer.getModel().getHelpSet(); if (hs == null) { return null; } return hs.getHelpSetURL(); }
Locale locale = ((JHelp)getControl()).getModel().getHelpSet().getLocale(); Enumeration items = historyModel.getBackwardHistory().elements(); JMenuItem mi = null;
/** * Visits a given ID. Propagates down into the model. * * @param id The String to visit. Relative to the HS of the current model. * @exception BadIDException The ID is not valid for the HelpSet for the current model. */ public void setCurrentID(String id) throws BadIDException { try { model.setCurrentID(ID.create(id, getModel().getHelpSet())); } catch (InvalidHelpSetContextException ex) { // cannot happen } }
Locale locale = ((JHelp)getControl()).getModel().getHelpSet().getLocale(); Enumeration items = historyModel.getForwardHistory().elements(); JMenuItem mi = null;
/** * Convenience version of the above. The implicit HelpSet is * the current HelpSet. * * @param id The String to visit. Null id is valid for TextHelpModel.setCurrentID. * @exception BadIDException if the string is not in the map for the HelpSet. */ public void setCurrentID(String id) throws BadIDException { try { helpModel.setCurrentID(ID.create(id, getModel().getHelpSet())); } catch (InvalidHelpSetContextException ex) { // cannot happen } }
protected void setupNavigators() { HelpSet hs = helpModel.getHelpSet(); // Simply return if the hs is null if (hs == null) { return; } // Now add all the navigators NavigatorView views[] = hs.getNavigatorViews(); debug("views: "+views); for (int i=0; i<views.length; i++) { debug(" processing info: "+views[i]); // We are currently assuming all the Navigators are JComponents JHelpNavigator nav = (JHelpNavigator) views[i].createNavigator(helpModel); if (nav == null) { // For now... debug("no JHelpNavigator for given info"); } else { debug(" adding the navigator"); navigators.addElement(nav); // HERE -- I don't think we want to change again the model // this.addHelpNavigator(nav); } } }
if (newModel != oldModel) { if (oldModel != null) { oldModel.getHelpSet().removeHelpSetListener(this); HelpSet hs = newModel.getHelpSet(); if (hs != null) { hs.addHelpSetListener(this);
/** Creates new ReloadAction */ public ReloadAction(Object control) { super(control, NAME); putValue("icon", UIManager.getIcon(NAME + ".icon")); if (control instanceof JHelp) { JHelp help = (JHelp) control; Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } }
/** Creates new HomeAction */ public HomeAction(Object control) { super(control, NAME); putValue("icon", UIManager.getIcon(NAME + ".icon")); if (control instanceof JHelp) { JHelp help = (JHelp) control; Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } }
public void actionPerformed(java.awt.event.ActionEvent event) { try { JHelp help = (JHelp)getControl(); HelpSet hs = help.getModel().getHelpSet(); Map.ID homeID = hs.getHomeID(); Locale locale = hs.getLocale(); String string = HelpUtilities.getString(locale, "history.homePage"); help.setCurrentID(homeID, string, help.getCurrentNavigator()); } catch (Exception e) { } } }
/** Creates new FavoritesAction */ public FavoritesAction(Object control) { super(control, NAME); if (control instanceof JHelp) { JHelp help = (JHelp)control; for (Enumeration e = help.getHelpNavigators(); e.hasMoreElements();) { JHelpNavigator nav = (JHelpNavigator)e.nextElement(); if(nav instanceof JHelpFavoritesNavigator) { favorites = (JHelpFavoritesNavigator)nav; favoritesActionListener = favorites.getAddAction(); } } setEnabled(favoritesActionListener != null); putValue("icon", UIManager.getIcon(NAME + ".icon")); Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } }
TextHelpModel thm = ((JHelpContentViewer)c).getModel(); if (thm != null) { hs = thm.getHelpSet();
/** Creates new BackAction */ public PrintAction(Object control) { super(control, NAME); if (control instanceof JHelp) { JHelp help = (JHelp)control; handler = JHelpPrintHandler.getJHelpPrintHandler(help); handler.addPropertyChangeListener(this); Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } putValue("icon", UIManager.getIcon(NAME + ".icon")); }
/** Creates new BackAction */ public PrintSetupAction(Object control) { super(control, NAME); if (getControl() instanceof JHelp) { JHelp help = (JHelp)control; handler = JHelpPrintHandler.getJHelpPrintHandler(help); handler.addPropertyChangeListener(this); Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } putValue("icon", UIManager.getIcon(NAME + ".icon")); }
/** Creates new BackAction */ public BackAction(Object control) { super(control, NAME); if (control instanceof JHelp) { JHelp help = (JHelp)control; historyModel = help.getHistoryModel(); historyModel.addHelpHistoryModelListener(this); setEnabled(historyModel.getIndex() > 0); putValue("icon", UIManager.getIcon(NAME + ".icon")); Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } }
/** Creates new ForwardAction */ public ForwardAction(Object control) { super(control, NAME); if (control instanceof JHelp) { JHelp help = (JHelp)control; historyModel = help.getHistoryModel(); historyModel.addHelpHistoryModelListener(this); setEnabled(historyModel.getIndex() > 0); putValue("icon", UIManager.getIcon(NAME + ".icon")); Locale locale = null; try { locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault(); } putValue("tooltip", HelpUtilities.getString(locale, "tooltip." + NAME)); putValue("access", HelpUtilities.getString(locale, "access." + NAME)); } }
TextHelpModel model = theViewer.getModel(); model.setDocumentTitle(title); ID id = model.getHelpSet().getCombinedMap().getIDFromURL(url); if (id != null) { try {
private void rebuild() { debug("rebuild"); TextHelpModel model = theViewer.getModel(); if (model == null) { debug("rebuild-end: model is null"); return; } /** * html future additions * if we were doing any highlighting the highlights would need * to be removed here */ HelpSet hs = model.getHelpSet(); // for glossary - not set homeID page - glossary is not synchronized if(theViewer.getSynch()){ try { Map.ID homeID = hs.getHomeID(); Locale locale = hs.getLocale(); String name = HelpUtilities.getString(locale, "history.homePage"); model.setCurrentID(homeID, name, (JHelpNavigator)null); html.setURL(model.getCurrentURL()); } catch (Exception e) { // ignore } } debug("rebuild-end"); }
locale = help.getModel().getHelpSet().getLocale(); } catch (NullPointerException npe) { locale = Locale.getDefault();
private void rebuild() { debug("rebuild"); TextHelpModel model = theViewer.getModel(); if (model == null) { debug("rebuild-end: model is null"); return; } // The model has changed. I'll need to clear the HTML viewer and // put in the home page Highlighter h = html.getHighlighter(); debug("removeAllHighlights"); h.removeAllHighlights(); HelpSet hs = model.getHelpSet(); // for glossary - not set homeID page - glossary is not synchronized if(theViewer.getSynch()){ try { Map.ID homeID = hs.getHomeID(); Locale locale = hs.getLocale(); String name = HelpUtilities.getString(locale, "history.homePage"); model.setCurrentID(homeID, name, (JHelpNavigator)null); html.setPage(model.getCurrentURL()); } catch (Exception e) { // ignore } } debug("rebuild-end"); }