Class HelpBrowser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, IHelpBrowser

public class HelpBrowser extends JFrame implements IHelpBrowser
Help browser displaying HTML pages fetched from JOSM wiki.
See Also:
  • Field Details

  • Constructor Details

    • HelpBrowser

      public HelpBrowser()
      Constructs a new HelpBrowser.
  • Method Details

    • getInstance

      public static HelpBrowser getInstance()
      Replies the unique instance of the help browser
      Returns:
      the unique instance of the help browser
    • setUrlForHelpTopic

      public static void setUrlForHelpTopic(String helpTopic)
      Show the help page for help topic helpTopic.
      Parameters:
      helpTopic - the help topic
    • buildStyleSheet

      Builds the style sheet used in the internal help browser
      Returns:
      the style sheet
    • buildToolBar

      protected JToolBar buildToolBar()
      Builds toolbar.
      Returns:
      the toolbar
    • build

      protected final void build()
      Builds GUI.
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class Window
    • loadTopic

      protected void loadTopic(String content)
      Load help topic.
      Parameters:
      content - topic contents
    • getUrl

      public String getUrl()
      Description copied from interface: IHelpBrowser
      Replies the current URL.
      Specified by:
      getUrl in interface IHelpBrowser
      Returns:
      the current URL
    • setUrl

      public void setUrl(String url)
      Description copied from interface: IHelpBrowser
      Sets the current URL.
      Specified by:
      setUrl in interface IHelpBrowser
      Parameters:
      url - the current URL
    • handleMissingHelpContent

      protected void handleMissingHelpContent(String relativeHelpTopic)
      Displays a warning page when a help topic doesn't exist yet.
      Parameters:
      relativeHelpTopic - the help topic
    • handleHelpContentReaderException

      protected void handleHelpContentReaderException(String relativeHelpTopic, HelpContentReaderException e)
      Displays a error page if a help topic couldn't be loaded because of network or IO error.
      Parameters:
      relativeHelpTopic - the help topic
      e - the exception
    • loadRelativeHelpTopic

      protected void loadRelativeHelpTopic(String relativeHelpTopic)
      Loads a help topic given by a relative help topic name (i.e. "/Action/New") First tries to load the language specific help topic. If it is missing, tries to load the topic in English.
      Parameters:
      relativeHelpTopic - the relative help topic
    • loadAbsoluteHelpTopic

      protected void loadAbsoluteHelpTopic(String absoluteHelpTopic)
      Loads a help topic given by an absolute help topic name, i.e. "/De:Help/Action/New"
      Parameters:
      absoluteHelpTopic - the absolute help topic name
    • openUrl

      public void openUrl(String url)
      Description copied from interface: IHelpBrowser
      Opens an URL and displays the content. If the URL is the locator of an absolute help topic, help content is loaded from the JOSM wiki. Otherwise, the help browser loads the page from the given URL.
      Specified by:
      openUrl in interface IHelpBrowser
      Parameters:
      url - the url
    • openHelpTopic

      public void openHelpTopic(String relativeHelpTopic)
      Description copied from interface: IHelpBrowser
      Loads and displays the help information for a help topic given by a relative help topic name, i.e. "/Action/New".
      Specified by:
      openHelpTopic in interface IHelpBrowser
      Parameters:
      relativeHelpTopic - the relative help topic
    • getHistory

      Description copied from interface: IHelpBrowser
      Replies the browser history.
      Specified by:
      getHistory in interface IHelpBrowser
      Returns:
      the browser history