All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.ui.framework.java.HelpViewer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----com.sun.java.swing.JFrame
                                           |
                                           +----com.ibm.as400.ui.framework.java.HelpViewer

public class HelpViewer
extends JFrame
Displays HTML-based help information in its own frame window. The frame window has several buttons:
Help Topics
Goes to a home page where it is intended that an index of hyperlinks is kept. The home page is set by setHome().
Back
Returns to the last displayed page.
Next
Proceeds forward to the next displayed page.
Copy
Copies the ASCII text on the page to the clipboard.

HelpViewer is in essence a mini-browser. It correctly displays any HTML 2.0 content. It will hyperlink directly to a file in the same jar file given a relative address, or it can hyperlink to any page on the web given a complete URL. Bear in mind that the linked-to page must have content compatible with HTML 2.0, and that if your site uses a firewall, the java environment must be set to use a proxy.

HelpViewer can be initialized with the URL of an html file, or the name of an HTML file in the CLASSPATH. If a name is specified, the HTML file, as well as the directory or .jar file will be determined. The .jar file will be used as a base for further relative links.


Constructor Index

 o HelpViewer(String)
Constructs a help viewer.
 o HelpViewer(URL)
Constructs a help viewer.

Method Index

 o getBase()
 o getHome()
Retrieves the current "home" setting, which is where the Help Topics button goes when pressed.
 o getJar()
Gets the current jar file being used.
 o main(String[])
 o setBase(String)
 o setHome(String)
Sets the current "home" setting, which is where the Help Topics button goes when pressed.
 o setHome(URL)
Sets the current "home" setting, which is where the Help Topics button goes when pressed.
 o showHome()
Causes the HTML display window to retrieve and show the home URL.
 o showPage(String)
Causes the HTML display window to retrieve and display a page.
 o showPage(URL)
Causes the HTML display window to retrieve and show the passed-in URL.

Constructors

 o HelpViewer
 public HelpViewer(URL u)
Constructs a help viewer. Uses the input URL as the display. Sets home base to be the URL minus any anchor. If the URL is only a.jar file, the jar file is set for further show pages, and nothing is shown.

Parameters:
the - URL to display and use as home base
 o HelpViewer
 public HelpViewer(String strFile)
Constructs a help viewer. A string input is assumed to be a help resource. A search is made of the ClassPath to find the resource. The directory or .jar file where the resource is found is used to find subsequent help resources. Home is set to the resulting HTML file minus any anchor. The .html extension may be left off, it will be automatically added, along with locale information when the classpath is searched.

Parameters:
the - file Name

Methods

 o main
 public static void main(String args[])
 o getHome
 public String getHome()
Retrieves the current "home" setting, which is where the Help Topics button goes when pressed.

Returns:
the home URL
 o setHome
 public void setHome(URL u)
Sets the current "home" setting, which is where the Help Topics button goes when pressed.

Parameters:
u - the URL of "home"
 o setHome
 public void setHome(String home)
Sets the current "home" setting, which is where the Help Topics button goes when pressed. Must be consistent with the jar settings set in the constructor.

Parameters:
home - the home value.
 o getJar
 public String getJar()
Gets the current jar file being used.

Returns:
jarFile as a string
 o setBase
 public void setBase(String base)
 o getBase
 public String getBase()
 o showPage
 public void showPage(URL u)
Causes the HTML display window to retrieve and show the passed-in URL. Does not concatenate the base value to the front of the URL.

Parameters:
u - the URL to be displayed.
 o showPage
 public void showPage(String sURL)
Causes the HTML display window to retrieve and display a page. If the input is a complete URL, it will be retrieved and shown. If only a File name, the input will be found in the jar file, or in a directory in the CLASSPATH and shown.

Parameters:
sURL - the page to be displayed.
 o showHome
 public void showHome()
Causes the HTML display window to retrieve and show the home URL. Uses the current value home value without modification.


All Packages  Class Hierarchy  This Package  Previous  Next  Index