Oracle Help for Java API Reference
Release 4.2.7.0.0
B12198-01

oracle.help.htmlBrowser
Interface HTMLBrowser

All Known Implementing Classes:
ICEBrowser

public interface HTMLBrowser

Oracle Help for Java depends on a pluggable HTML display engine (browser) to display help documents. This interface encapsulates the standard operations that need to be supported by such browsers. OHJ only interacts with browsers via this interface.

An HTMLBrowser implementation must support the following features for Help to be fully functional :

Oracle Help for Java includes the ICEBrowser implementation of the HTMLBrowser interface. The ICEBrowser implementation wraps ICESoft AS's ICE Browser which has been licensed for use with Oracle Help for Java.

See Also:
URLEvent, URLListener, ProtocolEvent, ProtocolListener, ICEBrowser

Method Summary
 void addPopupListener(oracle.help.htmlBrowser.PopupListener listener)
          Adds a popup listener.
 void addProtocolListener(oracle.help.htmlBrowser.ProtocolListener listener)
          Adds a protocol listener.
 void addURLListener(oracle.help.htmlBrowser.URLListener listener)
          Adds a url listener.
 boolean canGoBack()
          Determines whether it is possible to move backward
 boolean canGoForward()
          Determines whether it is possible to move forward in the stack.
 void clear()
          Instructs the HTMLBrowser to clear the display of any loaded HTML
 void decreaseFontSize()
          Decreases the font size used by the TopicDisplay
 void dispose()
          Disposes HTMLBrowser resources
 java.lang.String getCharset()
          Gets the HTML character encoding.
 java.lang.String getCurrentPageTitle()
          Returns the title of the page currently viewed in the browser
 java.awt.Dimension getCurrentRenderedSize()
          Returns the size of the rendered document.
 javax.swing.JPanel getHTMLContainer()
          Returns a JPanel containing the HTMLBrowser if possible, null otherwise.
 java.util.Locale getLocale()
          Gets the Locale set on the HTMLBrowser.
 java.awt.print.Printable getPrintable(java.net.URL[] urls)
          Get the printable to be printed for the specified URLs
 java.lang.String getSelectedText()
          Gets the text highlighted in the TopicDisplay
 java.net.URL getURL()
          Returns the currently displayed URL.
 void goBack()
          Goes back
 void goForward()
          Goes forward in the stack.
 void increaseFontSize()
          Increases the font size used by the TopicDisplay
 boolean isPrintingSupported()
          Determines whether printing is supported by this HTMLBrowser.
 void printURL(java.net.URL url)
          Print the HTML page at the given URL
 void printURLs(java.net.URL[] urls)
          Prints the HTML pages given (in book form if possible)
 void reloadURL()
          Reloads the current URL.
 void removePopupListener(oracle.help.htmlBrowser.PopupListener listener)
          Removes a popup listener.
 void removeProtocolListener(oracle.help.htmlBrowser.ProtocolListener listener)
          Removes a ProtocolLink listener.
 void removeURLListener(oracle.help.htmlBrowser.URLListener listener)
          Removes a url listener.
 void runFindDialog()
          Runs the FindDialog via CTRL-F and Tools|Find menu seaches.
 void selectAll()
          Selects all the text in the browser window
 void setCharset(java.lang.String charset)
          Sets the character encoding to be used when loading URLs.
 void setDefaultBackground(java.awt.Color bgcolor)
          Sets the default background color for HTML pages.
 void setDefaultLinkForeground(java.awt.Color linkfg)
          Sets the default foreground color for links on HTML pages.
 void setDefaultTextForeground(java.awt.Color textfg)
          Sets the default foreground color for plain text on HTML pages.
 void setLocale(java.util.Locale aLocale)
          Sets the Locale on the HTMLBrowser, if possible.
 void setURL(java.net.URL url)
          Sets the HTMLBrowser URL to the specified URL.
 void setURL(java.net.URL url, boolean waitForRendering)
          Sets the HTMLBrowser URL to the specified URL.
 

Method Detail

setURL

public void setURL(java.net.URL url)
Sets the HTMLBrowser URL to the specified URL.

Parameters:
url - url is the URL to be displayed

setURL

public void setURL(java.net.URL url,
                   boolean waitForRendering)
Sets the HTMLBrowser URL to the specified URL. If waitForRendering is set to true, the method will render the HTML page synchronously (if the underlying browser permits).

Parameters:
url - url is the URL to be displayed
waitForRendering - if true the page will be rendered synchronously (if the underlying browser permits).

clear

public void clear()
Instructs the HTMLBrowser to clear the display of any loaded HTML

reloadURL

public void reloadURL()
Reloads the current URL.

getPrintable

public java.awt.print.Printable getPrintable(java.net.URL[] urls)
Get the printable to be printed for the specified URLs

getURL

public java.net.URL getURL()
Returns the currently displayed URL.
Returns:
The current URL.

getHTMLContainer

public javax.swing.JPanel getHTMLContainer()
Returns a JPanel containing the HTMLBrowser if possible, null otherwise.

getCurrentRenderedSize

public java.awt.Dimension getCurrentRenderedSize()
Returns the size of the rendered document.

isPrintingSupported

public boolean isPrintingSupported()
Determines whether printing is supported by this HTMLBrowser.
Returns:
true if printing support; false otherwise;

printURL

public void printURL(java.net.URL url)
Print the HTML page at the given URL
Parameters:
url - the URL to be printed

printURLs

public void printURLs(java.net.URL[] urls)
Prints the HTML pages given (in book form if possible)
Parameters:
urls - the URL[] to be printed

addURLListener

public void addURLListener(oracle.help.htmlBrowser.URLListener listener)
Adds a url listener. All the registered URLListeners will be notified when the current page is replaced by a new page. This can happen when user selects a HTML link in the current page or when help requests HTMLBrowser to show a document.

This is required to support auto-tree-refresh feature in Help.

Parameters:
listener - URLListener to be added.

removeURLListener

public void removeURLListener(oracle.help.htmlBrowser.URLListener listener)
Removes a url listener.
Parameters:
listener - URLListener to be removed.

addPopupListener

public void addPopupListener(oracle.help.htmlBrowser.PopupListener listener)
Adds a popup listener. All the registered PopupListeners will be notified when user activates the popupTrigger. Right mouse click triggers popup event on most of the platforms.

Parameters:
listener - PopupListener to be added

removePopupListener

public void removePopupListener(oracle.help.htmlBrowser.PopupListener listener)
Removes a popup listener.
Parameters:
listener - PopupListener to be removed.

runFindDialog

public void runFindDialog()
Runs the FindDialog via CTRL-F and Tools|Find menu seaches.

getCharset

public java.lang.String getCharset()
Gets the HTML character encoding. This is required for supporting internationalization in Help.

Returns:
HTML character encoding

setCharset

public void setCharset(java.lang.String charset)
Sets the character encoding to be used when loading URLs. This charset is used only when there is no character set information found in the URL. This is required for supporting internationalization in Help.

Parameters:
charset - A java supported character encoding

getLocale

public java.util.Locale getLocale()
Gets the Locale set on the HTMLBrowser.

Returns:
HTML character encoding

setLocale

public void setLocale(java.util.Locale aLocale)
Sets the Locale on the HTMLBrowser, if possible.

Parameters:
charset - A java supported character encoding

setDefaultBackground

public void setDefaultBackground(java.awt.Color bgcolor)
Sets the default background color for HTML pages. This is required for full support of window types.

Parameters:
bgcolor - The new default background color

setDefaultTextForeground

public void setDefaultTextForeground(java.awt.Color textfg)
Sets the default foreground color for plain text on HTML pages. This is required for full support of window types.

Parameters:
textfg - The new default text foreground color

setDefaultLinkForeground

public void setDefaultLinkForeground(java.awt.Color linkfg)
Sets the default foreground color for links on HTML pages. This is required for full support of window types.

Parameters:
linkfg - The new default link foreground color

addProtocolListener

public void addProtocolListener(oracle.help.htmlBrowser.ProtocolListener listener)
Adds a protocol listener. All the registered listeners will be notified when the user selects a special protocol link in the document.

Parameters:
listener - ProtocolListener to be added.

removeProtocolListener

public void removeProtocolListener(oracle.help.htmlBrowser.ProtocolListener listener)
Removes a ProtocolLink listener.
Parameters:
listener - Listener to be removed.

dispose

public void dispose()
Disposes HTMLBrowser resources

canGoBack

public boolean canGoBack()
Determines whether it is possible to move backward
Returns:
true if possible; false otherwise;

goBack

public void goBack()
Goes back

canGoForward

public boolean canGoForward()
Determines whether it is possible to move forward in the stack.
Returns:
true if possible; false otherwise;

goForward

public void goForward()
Goes forward in the stack.

getSelectedText

public java.lang.String getSelectedText()
Gets the text highlighted in the TopicDisplay

increaseFontSize

public void increaseFontSize()
Increases the font size used by the TopicDisplay

decreaseFontSize

public void decreaseFontSize()
Decreases the font size used by the TopicDisplay

selectAll

public void selectAll()
Selects all the text in the browser window

getCurrentPageTitle

public java.lang.String getCurrentPageTitle()
Returns the title of the page currently viewed in the browser

HELP ${project.version}

Copyright © 1998,2003, Oracle. All Rights Reserved.