|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.framework.java.HelpViewer
Displays HTML-based help information in a JavaHelp window. For more information about JavaHelp, go to the Sun site.
HelpViewer correctly displays any HTML 3.2 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. The linked-to page must have content compatible with HTML 3.2, and can not contain JavaScript of Java applets as JavaHelp doesn't support them.
If your site uses a firewall, the java environment must be set to use a proxy (see below).
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.
Sample code to set a proxy enabling URL's beyond a firewall:
Properties systemProperties = System.getProperties(); systemProperties.put("http.proxySet", "true"); systemProperties.put("http.proxyHost", "proxy.myco.com"); // insert your proxy inet here systemProperties.put("http.proxyPort", "81"); System.setProperties(systemProperties);
Field Summary | |
static javax.help.HelpBroker |
OpNavHelpBroker
|
Constructor Summary | |
HelpViewer()
Constructs a help viewer when help will be shown with a user-specified table of contents, index, and search. |
|
HelpViewer(java.lang.String strFile)
Constructs a help viewer. |
|
HelpViewer(java.net.URL u)
Constructs a help viewer. |
|
HelpViewer(java.net.URL u,
java.awt.Window w)
Constructs a help viewer when help will be shown from a modal window. |
Method Summary | |
static void |
clearCache()
|
protected void |
finalize()
|
java.lang.String |
getHome()
Retrieves the current "home" setting, which is where the Help Topics button goes when pressed. |
java.lang.String |
getJarFileName()
Gets the filename of the JAR file that contains the HelpSet. |
static void |
main(java.lang.String[] args)
Provides a command line interface to HelpViewer . |
static void |
setActivationWindow(java.awt.Window w)
Static method to set the owning modal window of the JavaHelp viewer. |
void |
setHome(java.lang.String home)
Sets the current "home" setting, which is where the Help Topics button goes when pressed. |
void |
setHome(java.net.URL u)
Sets the current "home" setting, which is where the Help Topics button goes when pressed. |
void |
setIconImage(java.awt.Image img)
|
void |
setJarFileName(java.lang.String s)
Sets the filename of the JAR file that contains the HelpSet. |
void |
setParentWindow(java.awt.Window w)
Sets the owning modal window of the JavaHelp viewer. |
void |
setTitle(java.lang.String s)
Sets the title of the JavaHelp viewer. |
void |
showHome()
Causes the HTML display window to retrieve and display a page. |
void |
showHTML(java.lang.String HTMLText,
java.lang.String anchor)
Causes JavaHelp to display the passed String. |
void |
showPage(java.lang.String strFile)
Causes JavaHelp to retrieve and display a page. |
void |
showPage(java.lang.String ID,
java.lang.String HS)
Causes JavaHelp to display the HTML file mapped to the passed ID (defined in the JavaHelp map file). |
void |
showPage(java.net.URL uResource)
Causes JavaHelp to retrieve and show the passed-in URL. |
void |
showPage(java.net.URL u,
java.lang.String HS)
Causes JavaHelp to display the URL. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static javax.help.HelpBroker OpNavHelpBroker
Constructor Detail |
public HelpViewer()
Only use this constructor when you are displaying help in a user-specified HelpSet file. For example:
HelpViewer hv = new HelpViewer(); hv.showPage("myID", "file:///g:/myhtml/myHS.hs");The ID is the ID of HTML file to be displayed (defined in the JavaHelp map file), and the HelpSet is the JavaHelp HelpSet.
public HelpViewer(java.net.URL u)
u
- the URL to displaypublic HelpViewer(java.lang.String strFile)
The following displays myHTML.html when it is in a JAR file in the classpath or when the root directory is in the classpath:
HelpViewer hv = new HelpViewer("myhtml/myHTML.hmtl"); hv.showPage("myhtml/myHTML.hmtl");You can also fully qualify the path to the file, such as "file:///c:/myhtml/myHTML.html".
strFile
- the file Namepublic HelpViewer(java.net.URL u, java.awt.Window w)
u
- the URL to displayw
- the parent windowMethod Detail |
public static void main(java.lang.String[] args)
HelpViewer
. Allows
preview of HTML documents, including those within a JAR file. Searches for
the HTML document within the classpath.
java com.ibm.as400.ui.framework.java.HelpViewer <resource URL> | <document name>or
java com.ibm.as400.ui.framework.java.HelpViewer <ID> <HelpSet>
The HTML document must be specified as one of the following:
- <resource URL>
- The fully qualified URL of the HTML document.
Example: java com.ibm.as400.ui.framework.java.HelpViewer "file:///c:/myhtml/mypage.html"
- <document name>
- The fully qualified document name. Directories and JARs in the classpath will be searched.
Example: java com.ibm.as400.ui.framework.java.HelpViewer "mypage.html"
Example: java com.ibm.as400.ui.framework.java.HelpViewer "com/myco/mypackage/mypage.html"
- <ID>
- ID of the HTML file to be displayed (defined in the JavaHelp map file).
- <HelpSet>
- The JavaHelp HelpSet file associated with this help topic.
args
- the arguements passed to main().public void showPage(java.lang.String strFile)
strFile
- the page to be displayed.public void showPage(java.net.URL uResource)
URL
- the URL to be displayed.public void showPage(java.lang.String ID, java.lang.String HS)
HelpViewer hv = new HelpViewer(); hv.showPage(myID, file:///g:/myhtml/myHS.hs)
ID
- the ID of HTML file to be displayed (defined in the JavaHelp map file).HS
- the JavaHelp HelpSet that calls out the JavaHelp map file.public void showPage(java.net.URL u, java.lang.String HS)
HelpViewer hv = new HelpViewer(); hv.showPage(URL, file:///g:/myhtml/myHS.hs)
u
- the URL of the HTML file to be displayed.HS
- the JavaHelp HelpSet to use when displaying the URL.public void showHTML(java.lang.String HTMLText, java.lang.String anchor)
Warning: This method will not work in applet mode.
HTMLText
- the text to be displayed.anchor
- the anchor to navigate to.
public java.lang.String getHome()
public void setHome(java.net.URL u)
u
- the home URLpublic void setHome(java.lang.String home)
home
- the home URLpublic void showHome()
public void setIconImage(java.awt.Image img)
public void setParentWindow(java.awt.Window w)
w
- the owning modal window.public static void setActivationWindow(java.awt.Window w)
w
- the owning modal window.public void setTitle(java.lang.String s)
s
- the title.public void setJarFileName(java.lang.String s)
s
- the filname of the JAR.public java.lang.String getJarFileName()
public static void clearCache()
protected void finalize()
finalize
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |