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) { } } }
/** * @return The URL to the HelpSet. */ public URL getHelpSetURL() { HelpSet hs = contentViewer.getModel().getHelpSet(); if (hs == null) { return null; } return hs.getHelpSetURL(); }
/** * Determines the current navigator. */ public String getCurrentView() { debug("getCurrentView"); // always use the current view if the jhelp exists. if (jhelp != null) { currentView = jhelp.getCurrentNavigator().getNavigatorName(); } return currentView; }
public void actionPerformed(java.awt.event.ActionEvent event) { JHelp help = (JHelp)getControl(); JHelpContentViewer viewer = help.getContentViewer(); viewer.reload(); } }
/** * 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(); }
/** * 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); }
/** * 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); }
/** * 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"); mw.setCurrentID(id); }
/** * Adds a listener for the HelpModelEvent posted after the model has * changed. * * @param l - The listener to add. * @see javax.help.HelpModel#removeHelpModelListener */ public void addHelpModelListener(HelpModelListener l) { getModel().addHelpModelListener(l); }
/** * Hides/Shows view. */ public void setViewDisplayed(boolean displayed) { debug ("setViewDisplayed"); if (jhelp != null) { jhelp.setNavigatorDisplayed(displayed); } viewDisplayed = displayed; }
/** * Displays the presentation to the user. */ public void setDisplayed(boolean b) { debug("setDisplayed"); mw.setDisplayed(b); }
/** * Displays this 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"); mw.setCurrentURL(url); }
/** * 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()); }
/** * Returns a list of selected items from the current navigator */ public TreeItem[] getSelectedItems() { return getCurrentNavigator().getSelectedItems(); }
/** * Removes a listener previously added with <tt>addHelpModelListener</tt> * * @param l - The listener to remove. * @see javax.help.HelpModel#addHelpModelListener */ public void removeHelpModelListener(HelpModelListener l) { getModel().removeHelpModelListener(l); }
/** * Determines which ID is displayed (if any). * @returns the current ID or null if there is none */ public ID getCurrentID() { debug("getCurrentID"); if (model != null) { return model.getCurrentID(); } return null; }
/** * Returns wheter node is allowed to have children or not. */ public boolean getAllowsChildren() { return ((FavoritesItem) getUserObject()).isFolder(); }
/** * Handy error message methods. */ private void parsingError(String key) { String s = HelpUtilities.getText(key); factory.reportMessage(s, false); // tree will be wrong }