|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.ui.framework.java.HelpViewer
public class HelpViewer extends Object
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);
| Modifier and Type | Field and Description |
|---|---|
static HelpBroker |
OpNavHelpBroker
|
| Constructor and Description |
|---|
HelpViewer()
Constructs a help viewer when help will be shown with a user-specified table of contents, index, and search. |
HelpViewer(String strFile)
Constructs a help viewer. |
HelpViewer(URL u)
Constructs a help viewer. |
HelpViewer(URL u,
Window w)
Constructs a help viewer when help will be shown from a modal window. |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache()
|
protected void |
finalize()
|
String |
getHome()
Retrieves the current "home" setting, which is where the Help Topics button goes when pressed. |
String |
getJarFileName()
Gets the filename of the JAR file that contains the HelpSet. |
static void |
main(String[] args)
Provides a command line interface to HelpViewer. |
static void |
setActivationWindow(Window w)
Static method to set the owning modal window of the JavaHelp viewer. |
void |
setHome(String home)
Sets the current "home" setting, which is where the Help Topics button goes when pressed. |
void |
setHome(URL u)
Sets the current "home" setting, which is where the Help Topics button goes when pressed. |
void |
setIconImage(Image img)
|
void |
setJarFileName(String s)
Sets the filename of the JAR file that contains the HelpSet. |
void |
setParentWindow(Window w)
Sets the owning modal window of the JavaHelp viewer. |
void |
setTitle(String s)
Sets the title of the JavaHelp viewer. |
void |
showHome()
Causes the HTML display window to retrieve and display a page. |
void |
showHTML(String HTMLText,
String anchor)
Causes JavaHelp to display the passed String. |
void |
showPage(String strFile)
Causes JavaHelp to retrieve and display a page. |
void |
showPage(String ID,
String HS)
Causes JavaHelp to display the HTML file mapped to the passed ID (defined in the JavaHelp map file). |
void |
showPage(URL uResource)
Causes JavaHelp to retrieve and show the passed-in URL. |
void |
showPage(URL u,
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 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(URL u)
u - the URL to displaypublic HelpViewer(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 Name
public HelpViewer(URL u,
Window w)
u - the URL to displayw - the parent window| Method Detail |
|---|
public static void main(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(String strFile)
strFile - the page to be displayed.public void showPage(URL uResource)
URL - the URL to be displayed.
public void showPage(String ID,
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(URL u,
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(String HTMLText,
String anchor)
Warning: This method will not work in applet mode.
HTMLText - the text to be displayed.anchor - the anchor to navigate to.public String getHome()
public void setHome(URL u)
u - the home URLpublic void setHome(String home)
home - the home URLpublic void showHome()
public void setIconImage(Image img)
public void setParentWindow(Window w)
w - the owning modal window.public static void setActivationWindow(Window w)
w - the owning modal window.public void setTitle(String s)
s - the title.public void setJarFileName(String s)
s - the filname of the JAR.public String getJarFileName()
public static void clearCache()
protected void finalize()
finalize in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||