|
Oracle Help for Java API Reference Release 4.2.7.0.0 B12198-01 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.help.viewer.Viewer
The Viewer class provides a stand-alone application for displaying large sets of HTML documentation.
While the Help class (the default OHJ implementation) is meant for displaying context sensitive help for an application, the Viewer class is an alternative implementation that is specialized for stand-alone display of large sets of HTML documentation.
The Viewer class displays HTML content in a page size, docked window by default. It also provides the ability to view certain topics in an external browser. This can be done at both authoring time and run time. The author can specify that a link should be shown in an external browser by using an OHJ protocol (prepending "external:" to a link). Not that this "external:" protocol only works in the Helpset Viewer, and not ordinary OHJ deployments. At runtime, the user can choose to launch a help topic in an external browser by pressing the "View in External Browser" button. Also, all .pdf files will automatically be shown in an external browser.
The user may edit preferences to specify which external browser should be used, if any at all. These preferences may be loaded from and stored to an .xml file if a valid path is given at the command line.
The ViewerApplication class provides a harness for launching the Viewer from the command line.
You may also create and control an instance of the Viewer programmatically. The Viewer API is very similar to that of the Help object. The APIs supported by this class can be divided into following categories :
addBook()
and removeBook()
methods respectively.
See the OHJ File Formats document for more information on the supported
file formats for Books.
showTopic()
methods. The application programmer specifies the topicID of the help
content page to show. This topicID is resolved to an HTML page through
the merged map file created from the Books added to the Viewer.
Book
Field Summary | |
static java.lang.String |
BROWSER_PATH
|
static java.lang.String |
EXTERNAL_ENABLED
|
static java.lang.String |
USE_DEFAULT_BROWSER
|
Constructor Summary | |
Viewer(java.net.URL openingPage,
boolean standAloneMode)
Creates an instance of the Viewer object with ViewerICEBrowser as the HTMLBrowser component used for topic display. |
|
Viewer(java.net.URL openingPage,
boolean combineBooks,
boolean useLabelInfo,
boolean standAloneMode)
Creates an instance of the Viewer object with ViewerICEBrowser as the HTMLBrowser component used for topic display. |
Method Summary | |
void |
addBook(Book book)
Add a book to the Viewer's library. |
void |
dispose()
Dispose the Viewer. |
Navigator[] |
getAllNavigators()
Get the Navigator objects displayed in the Navigator Window. |
int |
getBookCount()
Returns the number of Book objects currently in the Viewer's library. |
Book[] |
getBooks()
Get all of the Book objects currently in the Viewer's library. |
static java.lang.String |
getHelpEncoding()
Get the Character Set Encoding used by the Oracle Help for Java classes for reading in client help files. |
static java.util.Locale |
getHelpLocale()
Get the Locale currently being used by the Oracle Help for Java classes for Locale sensitive operations and resource loading. |
void |
removeAllBooks()
Removes all books from the Viewer's library. |
void |
removeBook(Book book)
Remove a book from the Viewer. |
static void |
setHelpEncoding(java.lang.String helpEncoding)
Set the Character Set Encoding used by the Oracle Help for Java classes for reading in client help files. |
static void |
setHelpLocale(java.util.Locale helpLocale)
Set the Locale used by the Oracle Help for Java classes for Locale sensitive operations and resource loading. |
void |
setHelpOnHelp(Book book,
java.lang.String topicID)
Calling this method with valid book and topicID parameters will enable the "Help on Help" menu option in the Help Navigator. |
void |
setHelpOnHelp(java.net.URL helpOnHelpURL)
Calling this method with a valid URL parameter will enable the "Help on Help" menu option in the Viewer Navigator. |
void |
setIconImage(java.awt.Image iconImage)
Call this method to set a custom image for the window icons in the Oracle Help for Java windows. |
void |
setVisible(boolean visible)
Sets the visibility of the Viewer. |
void |
showNavigatorWindow()
Show the Navigator Window |
void |
showNavigatorWindow(Book activeBook)
Show the Navigator Window with the NavigatorTabPanel for the given Book initially displayed. |
void |
showNavigatorWindow(Navigator activeNavigator)
Show the Navigator Window with a specific Navigator displayed initially. |
void |
showTopic(Book book,
java.lang.String topicID)
Shows the given topic from the given book in a currently existing topic window. |
void |
showTopic(Book book,
java.lang.String topicID,
boolean alwaysCreate)
Shows the given topic from the given book. |
void |
showTopic(Book book,
java.lang.String topicID,
boolean alwaysCreate,
java.awt.Point location,
java.awt.Dimension size)
Shows the given topic from the given book. |
void |
topicActivated(oracle.help.navigator.NavigatorEvent e)
Public method as a result of the NavigatorListener interface. |
void |
topicSelected(oracle.help.navigator.NavigatorEvent e)
Public method as a result of the NavigatorListener interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String EXTERNAL_ENABLED
public static final java.lang.String USE_DEFAULT_BROWSER
public static final java.lang.String BROWSER_PATH
Constructor Detail |
public Viewer(java.net.URL openingPage, boolean standAloneMode)
openingPage
- the page which should be displayed upon starting
up the applicationstandAloneMode
- if true the Viewer will
exit the JVM when all Viewer
have been closed. This should be
set to false if you are launching the
Viewer from your java application.oracle.help.htmlBrowser.ViewerICEBrowser
public Viewer(java.net.URL openingPage, boolean combineBooks, boolean useLabelInfo, boolean standAloneMode)
openingPage
- the page which should be displayed upon starting
up the applicationcombineBooks
- if true the help system will show all
of the views from the Books added to
the help system in one tab panel, if
false the help sytem will create a
different tab panel for each bookuseLabelInfo
- if true the help system uses the
author defined label information
for display and view merging,
if false the help system uses
standard Navigator labelsstandAloneMode
- if true the Viewer will
exit the JVM when all Viewer
have been closed. This should be
set to false if you are launching the
Viewer from your java application.Method Detail |
public static void setHelpLocale(java.util.Locale helpLocale)
Most clients will want to use the system default Locale (the Locale that has been chosen by the end user on their operating system), in which case you will not need to call this method.
Convenience wrapper for import oracle.help.common.util.java.StaticLocaleContext method
helpLocale
- -- The Locale, if null, the system
default Locale will be used.public static java.util.Locale getHelpLocale()
Convenience wrapper for import oracle.help.common.util.java.StaticLocaleContext method
public static void setHelpEncoding(java.lang.String helpEncoding)
Most clients will want to use the default encoding of the default Locale (the Locale that has been chosen by the end user on their operating system), in which case you will not need to call this method.
Convenience wrapper for import oracle.help.common.util.java.StaticLocaleContext method
helpEncoding
- -- The name of a Java supported
Character Set Encoding.public static java.lang.String getHelpEncoding()
Convenience wrapper for import oracle.help.common.util.java.StaticLocaleContext method
public void setIconImage(java.awt.Image iconImage)
iconImage
- -- The Image to use as the icon for the
Oracle Help for Java windows.public void setVisible(boolean visible)
visible
- if true the Viewer
will show the Navigator Window,
if false the Viewer will hide
the navigator window and all topic
windowspublic void addBook(Book book)
book
- the book to add
to the Viewer's
librarypublic void removeBook(Book book)
book
- the book to remove
from the Viewer's
librarypublic void removeAllBooks()
public Book[] getBooks()
public int getBookCount()
public void showNavigatorWindow()
public void showNavigatorWindow(Navigator activeNavigator)
activeNavigator
- -- the Navigator to show initially,
if parameter is null, the Navigator Window will
be shown with the previously selected Navigator
displayedpublic void showNavigatorWindow(Book activeBook)
activeBook
- -- the Book object whose associated
NavigatorTabPanel should be initially displayed when
the Navigator Window is shown. The Book should have
already been added to the Viewer, if it has not
been or if the parameter is null the previously selected
NavigatorTabPanel will be initially displayed.public Navigator[] getAllNavigators()
public void showTopic(Book book, java.lang.String topicID) throws oracle.help.topicDisplay.TopicDisplayException
book
- The book to show the topic from.topicID
- The topicID for the topic to show.oracle.help.topicDisplay.TopicDisplayException
- if the specified topic cannot be displayedpublic void showTopic(Book book, java.lang.String topicID, boolean alwaysCreate) throws oracle.help.topicDisplay.TopicDisplayException
book
- The book to show the topic from.topicID
- The topicID for the topic to show.alwaysCreate
- If true, always create a new window; if false, reuse
a window if possible.oracle.help.topicDisplay.TopicDisplayException
- if the specified topic cannot be displayedpublic void showTopic(Book book, java.lang.String topicID, boolean alwaysCreate, java.awt.Point location, java.awt.Dimension size) throws oracle.help.topicDisplay.TopicDisplayException
book
- The book to show the topic from.topicID
- The topicID for the topic to showalwaysCreate
- If true, always create a new window; if false, reuse
a window if possible.location
- Location of the topic window.size
- Size of the topic window.oracle.help.topicDisplay.TopicDisplayException
- if the specified topic cannot be displayedpublic void setHelpOnHelp(java.net.URL helpOnHelpURL)
helpOnHelpURL
- The url of an html page to display for Help on Help.public void setHelpOnHelp(Book book, java.lang.String topicID)
book
- the Book that contains the help on help topics (this
book must have been added to the help system)topicID
- the topic id of the help topic to display for Help
on Helppublic void dispose()
public void topicSelected(oracle.help.navigator.NavigatorEvent e)
topicSelected
in interface oracle.help.navigator.NavigatorListener
public void topicActivated(oracle.help.navigator.NavigatorEvent e)
topicActivated
in interface oracle.help.navigator.NavigatorListener
|
HELP ${project.version} | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |