|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
IBrowserCanvas
provides native browsing facilities inside a
standard java.awt.Canvas
. This interface provides a platform and
browser independant mechanism to access these native resources.
Some extra browser-specific functionality can be accessed via other supplied
interfaces. For example, Mozilla browsers can access the
IMozillaBrowserCanavas
interface which allows the user to save a
HTML page to a local drive.
IIEBrowserCanvas
,
IMozillaBrowserCanvas
Field Summary | |
static int |
KEY_CODE_BACKSPACE
|
static int |
KEY_CODE_DELETE
|
static int |
KEY_CODE_TAB
|
static int |
KEY_MODIFIER_CTRL_DOWN
|
static int |
KEY_MODIFIER_SHIFT_DOWN
|
static int |
PRINT_DEFAULT_ACTION
This flag is for the machine's default printing behaviour. |
static int |
PRINT_ORIENTATION_LANDSCAPE
|
static int |
PRINT_ORIENTATION_PORTRAIT
|
static int |
PRINT_SHOW_DIALOG_BOX
This flag is for showing the default print dialog. |
static int |
PRINT_SILENT
This flag is to prevent dialogs from showing when printing. |
static int |
PRINT_SILENT_SHOW_HELP
This flag allows silent printing with hepler dialogs where necessary. |
static int |
RELOAD_BYPASS_CACHE
This flag indicates to reload() that it should skip the
cache, but still use the proxy. |
static int |
RELOAD_BYPASS_PROXY
This flag indicates to reload() that it should use the
cache, but skip the proxy. |
static int |
RELOAD_BYPASS_PROXY_AND_CACHE
This flag indicates to reload() that it should skip the
cache and proxy. |
static int |
RELOAD_NORMAL
This flag indicates to reload() that it should use
the cache and proxy. |
Method Summary | |
void |
addBlockedURL(java.lang.String strURL)
Adds URL to the list of blocked URLs (URLs that are not displayed). |
void |
addBrowserListener(BrowserListener listener)
Adds the specified browser listener that will receive browser events from this component. |
void |
addDOMListener(DOMListener listener)
Adds the DOM listener to receive DOM events from this component. |
void |
addJavascriptListener(JavascriptListener listener)
Adds the specified Javascript listener that will receive Javascript events from this component. |
void |
addKeyListener(KeyListener listener)
Adds the specified Key listener that will receive network events from this component. |
void |
addMouseListener(MouseListener listener)
Adds the specified Mouse listener that will receive network events from this component. |
void |
addNetworkListener(NetworkListener listener)
Adds the specified network listener that will receive network events from this component. |
void |
addPrintListener(PrintListener listener)
Adds print status listener that will receive print events from this component. |
void |
addPromptListener(PromptListener listener)
Adds a PromptListener. |
void |
addWindowListener(WindowListener listener)
Adds the specified window listener that will receive new Window events from this component. |
void |
allowPopups(boolean bOnOff)
Enable or disable popups for this canvas. |
void |
autoconfigureProxy(java.lang.String url)
Automatgically configure proxy settings for protocols via a URL. |
void |
cancelSave()
Cancel downloading operation. |
boolean |
canGoBack()
Indicates whether the browser can navigate backwards in history. |
boolean |
canGoForward()
Indicates whether the browser can navigate forwards in history. |
void |
copy()
Copy the selected text to the clipboard. |
void |
cut()
Cut the selected text to the clipboard. |
void |
decreaseTextZoom()
Decreases the size of text on the page. |
void |
deleteCookies()
Deletes stored cookies. |
void |
destroy()
This functions destroys resources allocated by browser canvas. |
void |
disableCache()
Disables the cache. |
void |
disableClipping(boolean bDisable)
Disables clipping to parent swing component's viewable area. |
void |
disableCookies()
Disable cookies feature. |
void |
disableHTTPSDialog(boolean onOff)
Enables or disables display of security warning dialogs. |
void |
disableJInternalFrame()
Disables the JInternalFrame feature. |
void |
disableProxy()
Disable the current proxy settings |
void |
enableCache()
Enables the cache. |
void |
enableCookies()
Enables cookies feature. |
void |
enableDefaultContextMenu(boolean onOff)
Enable or disable the default right-click menu. |
void |
enableImageLoading(boolean enable)
Allow images to load. |
void |
enableJInternalFrame(javax.swing.JInternalFrame parent)
Enables the browser to be viewed in a JInternalFrame. |
void |
enableProxy()
Enables the current proxy settings |
void |
EventsFireStatus(boolean onOff)
Deprecated. Sets whether to block events. When this is set to false all Events will be blocked |
void |
executeScript(java.lang.String javascriptBody)
Executes the specified script on the currently loaded document. |
java.lang.String |
executeScriptWithReturn(java.lang.String javascriptBody)
Executes the specified script on the currently loaded document. |
boolean |
getAllowPopups()
Gets if this Browser Canvas can spawn popups. |
boolean |
getBoolPrefProperty(java.lang.String propName)
Gets the boolean value of a property. |
java.lang.String |
getBrowserType()
Get a string representation of the underlying browser. |
java.awt.Canvas |
getCanvas()
Get a canvas. |
java.lang.String |
getCompanyName()
Gets the name of the company. |
java.lang.String |
getCookie()
Gets the cookie for the currently loaded domain. |
java.lang.String |
getCookie(java.lang.String URL)
Gets the specified cookie. |
boolean |
getDefaultContextMenuStatus()
Gets whether the Default context menu is enabled for right mouse clicks. |
boolean |
getdisableHTTPSDialog()
Gets status of security warning dialog display setting. |
IDocument |
getDocument()
Get access to the DOM of the loaded document. |
IElement |
getElementAtCaretPosition(boolean returnTextNodes)
Retrieves the element under the cursor when in edit mode. |
History |
getHistory()
Gets the browser history. |
java.lang.String |
getHomeDirectory()
Retrieve the home directory used by WebRenderer. |
boolean |
getHTMLEditingMode()
Gets whether the current webpage is in editing mode. |
boolean |
getHTTPSDialog()
Deprecated. Gets status of security warning dialog display setting. |
int |
getIntPrefProperty(java.lang.String propName)
Gets the integer value of a property. |
boolean |
getJavascriptEnabled()
Gets if Javascript is enabled for this canvas. |
java.awt.Dimension |
getPageSize()
Get the size in pixels of the whole webpage. |
boolean |
getPopupParentWindow()
Gets whether popups will be opened in a new window or the current IBrowserCanvas
Default is false |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of WebRenderer. |
java.lang.String[] |
getPrinterNames()
Gets a list of the names of the printers currently installed |
java.lang.String |
getProductName()
Gets the name of the product. |
java.lang.String |
getProxyBypasses()
Gets a string containing the domain names which bypass the given proxy settings. |
ProxySetting |
getProxyProtocol(int protocol)
Retrieves the proxy settings for the given protocol. |
ScrollBarInfo |
getScrollBarInfo()
Returns the current scroll state of the outer document. |
java.lang.String |
getSelectedText()
Gets the active text selection in the browser. |
boolean |
getStatusBar()
Deprecated. |
java.lang.String |
getStringPrefProperty(java.lang.String propName)
Gets the String value of a property. |
java.lang.String |
getTitle()
Get the title of the current resource being displayed. |
java.lang.String |
getURL()
Get the URL of the current resource being displayed. |
java.lang.String |
getVersion()
Get the version of the product as a string. |
java.lang.String |
getWebRendererVersion()
Get a version identification string for components of WebRenderer. |
void |
goBack()
Move backwards through resource history. |
void |
goForward()
Move forward through resource history. |
void |
grabFocus()
Causes the IBrowserCanvas to become focused. |
void |
highlightSelectedText(java.awt.Color colour)
Changes the background color on the current selection to given color. |
void |
httpPOST(java.lang.String strURL,
java.io.File file,
java.lang.String fileVariableName)
Load URL with File which should be uploaded |
void |
httpPOST(java.lang.String strURL,
java.io.File file,
java.lang.String fileVariableName,
java.lang.String additionalPOSTData)
Load URL with POST String Data and File which should be uploaded Format of additionPOSTData parameter: name=Parameter_name\r\n\r\nParamter_value\r\n where Paramter_name is a form field name and Paramter_value is form field value |
void |
httpPOST(java.lang.String strURL,
java.lang.String POSTData)
Load URL with POST String Data |
void |
increaseTextZoom()
Increases the size of text on the page. |
void |
insertHTML(java.lang.String strHTMLText)
Insert some HTML source at the current location (active element). |
boolean |
isCacheDisabled()
Gets the disabled status of the cache. |
boolean |
isCookiesEnabled()
Gets the on/off status of the cookies feature |
boolean |
isDisableClipping()
Gets the Enable/disable clipping status |
boolean |
isPopup()
Get whether this browser is a popup window or not. |
boolean |
isProxyEnabled()
Gets the on/off status of the proxy settings |
boolean |
isScrollBarsVisible()
Returns flag that indicates if the scrollbars are visible or not |
void |
loadHTML(byte[] HTML,
java.lang.String relativePath)
Renders the content of a byte array on the IBrowserCanvas . |
void |
loadHTML(java.io.InputStream HTMLStream,
java.lang.String relativePath)
Renders the content of an Input Stream on the IBrowserCanvas |
void |
loadHTML(java.lang.String sHTML,
java.lang.String relativePath)
Renders the content of a string on the IBrowserCanvas . |
void |
loadURL(int NavConstants,
java.lang.String strURL,
byte[] POSTData,
java.lang.String TargetFrameName,
java.lang.String Headers)
Load URL with POST Byte Data, Headers data and TargetFrameName |
void |
loadURL(java.lang.String url)
Loads the resource at the given URL in the browser window. |
void |
loadURL(java.net.URL url)
Loads the resource at the given URL in the browser window. |
java.lang.String |
makeImageUrl(java.awt.image.BufferedImage img)
Registers this image in wrimage:// protocol. |
void |
openFileWithApp(java.lang.String strLocalPath,
java.lang.String strAppPath)
Deprecated. |
void |
paste()
Pastes the text from the clipboard to the current document This command can only be used when setHTMLEditingMode(true) has been
called on the IBrowserCanvas |
void |
print(int Options)
Print Document with options. |
void |
print(int Options,
java.lang.String PrinterName)
Print with options to a target printer |
int |
printPreview()
Displays in the IBrowserCanvas a print preview of the current page
To leave print preview mode, call this method again. |
void |
registerProtocol(java.lang.String protocol,
ProtocolListener l)
Registers a protocol to Mozilla or IE (Not availble on Safari. |
void |
reload(int flags)
Reload the current resource. |
void |
removeBlockedURL(java.lang.String strURL)
Removes a URL from the list of blocked URLs. |
void |
removeBrowserListener(BrowserListener listener)
Removes the specified browser listener so that it no longer receives browser events from this component. |
void |
removeDOMListener(DOMListener listener)
Removes a DOM listener so that it no longer receives DOM events from this component. |
void |
removeImage(java.lang.String imageID)
Removes a specified image. |
void |
removeJavascriptListener(JavascriptListener listener)
Removes the specified Javascript listener so that it no longer receives Javascript events from this component. |
void |
removeKeyListener(KeyListener listener)
Removes the specified Keyboard listener so that it no longer receives browser events from this component. |
void |
removeMouseListener(MouseListener listener)
Removes the specified Mouse listener so that it no longer receives browser events from this component. |
void |
removeNetworkListener(NetworkListener listener)
Removes the specified network listener so that it no longer receives network events from this component. |
void |
removePrintListener(PrintListener listener)
Removes a print status listener. |
void |
removePromptListener(PromptListener listener)
Removes the specified Prompt listener so that it no longer receives browser events from this component. |
void |
removeWindowListener(WindowListener listener)
Removes a WindowListener. |
int |
savePageToBitmapImage(java.lang.String strLocalFileName,
boolean full)
Save contents of HTML page to a bitmap image. |
java.awt.image.BufferedImage |
saveToBufferedImage(boolean bWholePage)
Saves the current page to a buffered image. |
java.awt.image.BufferedImage |
saveToBufferedImage(boolean bWholePage,
boolean bKeepAlpha)
Saves the current page to a buffered image. |
void |
saveToFile(java.lang.String filename)
Save the currently loaded page to disk. |
void |
scrollToX(int xPos)
Scrolls the brower along the x axis to specified position. |
void |
scrollToY(int yPos)
Scrolls the brower along the y axis to specified position. |
void |
selectAll()
Selects all text on the canvas. |
void |
sendKeyPressToElement(int keyCode,
int modifiers)
Sends a key event to the currently focused element with the given key code and character code. |
void |
setCookie(java.lang.String Value)
Sets the cookie for the currently loaded domain. |
void |
setCookie(java.lang.String URL,
java.lang.String Value)
Sets cookie for a given domain. |
boolean |
setHomeDirectory(java.lang.String newDirectory)
Set the home directory used by WebRenderer. |
void |
setHTMLEditingMode(boolean onOff)
Sets whether the page is in editing mode or not When a page is in editing mode, text can be dragged, and contents can be cut. |
void |
setJavascriptEnabled(boolean bOnOff)
Enable or disable Javascript for this canvas. |
void |
setPopupParentWindow(boolean bOnOff)
Navigate in the same window without popup windows creation. |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of WebRenderer. |
void |
setPrefProperty(java.lang.String pref,
boolean onOff)
Sets an optional property of the underlying browser. |
void |
setPrefProperty(java.lang.String pref,
int intPref)
Sets an optional property of the underlying browser. |
void |
setPrefProperty(java.lang.String pref,
java.lang.String stringPref)
Sets an optional property of the underlying browser. |
void |
setPrintPageOrientation(int orientation)
Set the page orientation for printing. |
void |
setProxyBypasses(java.lang.String urls)
Sets the domain names and URLs which bypass the proxy settings. |
void |
setProxyProtocol(ProxySetting proxy)
Sets the proxy settings. |
void |
showAboutBox()
Shows the JadeLiquid Logo and Registration Information. |
void |
showScrollBars(boolean bShow)
Shows/Hides scrollbars |
void |
stopLoad()
Stop the browser from loading a resource. |
void |
useDefaultProfile(boolean bTrue)
Use default mozilla/IE profile yes/no. |
Field Detail |
public static final int PRINT_ORIENTATION_PORTRAIT
public static final int PRINT_ORIENTATION_LANDSCAPE
public static final int KEY_MODIFIER_SHIFT_DOWN
public static final int KEY_MODIFIER_CTRL_DOWN
public static final int KEY_CODE_BACKSPACE
public static final int KEY_CODE_TAB
public static final int KEY_CODE_DELETE
public static final int RELOAD_NORMAL
reload()
that it should use
the cache and proxy.
reload(int)
,
Constant Field Valuespublic static final int RELOAD_BYPASS_CACHE
reload()
that it should skip the
cache, but still use the proxy.
reload(int)
,
Constant Field Valuespublic static final int RELOAD_BYPASS_PROXY
reload()
that it should use the
cache, but skip the proxy.
reload(int)
,
Constant Field Valuespublic static final int RELOAD_BYPASS_PROXY_AND_CACHE
reload()
that it should skip the
cache and proxy.
reload(int)
,
Constant Field Valuespublic static final int PRINT_DEFAULT_ACTION
public static final int PRINT_SHOW_DIALOG_BOX
public static final int PRINT_SILENT
public static final int PRINT_SILENT_SHOW_HELP
Method Detail |
public java.lang.String getBrowserType()
These values can be used to cast a IBrowserCanvas
interface
to a more platform-specific interface in order to access added
functionality. Examples of this are given at
IMozillaBrowserCanvas
and
IIEBrowserCanvas
and
ISafariBrowserCanvas
public java.awt.Canvas getCanvas()
IBrowserCanvas
down to a java.awt.Canvas
This is useful for adding the IBrowserCanvas
to AWT Containers.
public java.lang.String getProductName()
public java.lang.String getVersion()
public java.lang.String getWebRendererVersion()
public java.lang.String getCompanyName()
public void copy()
public void cut()
setHTMLEditingMode(boolean)
has been
enabled on the canvas.
public void selectAll()
public void loadURL(java.lang.String url)
url
- The URL of the resource to load.public void loadURL(java.net.URL url)
url
- The URL of the resource to load.public void stopLoad()
public void reload(int flags)
flags
- Defines the operation of reload. Must be one of the RELOAD flags.RELOAD_BYPASS_CACHE
,
RELOAD_BYPASS_PROXY
,
RELOAD_BYPASS_PROXY_AND_CACHE
,
RELOAD_NORMAL
public void loadHTML(java.lang.String sHTML, java.lang.String relativePath)
IBrowserCanvas
.
relativePath
- The path, relative to the current working directory, from which images are loaded.
This should point to a writable location. The protocol prefix should be file:///
, and a
/
must be the last character (e.g.: file:///E:/htmlresources/
).
If relativePath
is an empty string then the current application path is used as an absolute
base path for files.
Example:
String sHTML = "<HTML><BODY>Hello World!</BODY></HTML>";
File file = new File(".");
browser.loadHTML( sHTML, file.toURI().toString());
public void loadHTML(byte[] HTML, java.lang.String relativePath)
IBrowserCanvas
.
HTML
- A byte array containing the HTML data to display.relativePath
- The path, relative to the current working directory, from which images are loaded.
This should point to a writable location. The protocol prefix should be file:///
, and a
/
must be the last character (e.g.: file:///E:/htmlresources/
).
If relativePath
is an empty string then the current application path is used as an absolute
base path for files.
Example
File file = new File(".");
byte [] bBody = "<HEAD><BODY>Hello World</BODY></HEAD>".getBytes();
browser.loadHTML( HTML, file.toURI().toString() );
public void loadHTML(java.io.InputStream HTMLStream, java.lang.String relativePath)
IBrowserCanvas
HTMLStream
- - An InputStream containing the HTML code to displayrelativePath
- - The relative path from the current working directory to load images from
note: localPath should point to writable location. with set protocol prefix like file:/// and / as last character is essential
example file:///E:/htmlresources/
If localPath is an empty string then current application path used as an absolute base path for files.
Example Usage:
File file = new File(".");
byte [] bBody = "<HEAD><BODY>Hello World</BODY></HEAD>".getBytes();
ByteArrayInputStream bStream = new ByteArrayInputStream( bBody );
browser.loadHTML( bStream, file.toURI().toString() );
public boolean canGoBack()
true
if it can navigate backwards.public boolean canGoForward()
true
if goBack()
has been previously called
true
if it can navigate forwards.public void goBack()
public void goForward()
public java.lang.String getTitle()
title
tag.
public java.lang.String getURL()
public boolean isPopup()
public void showAboutBox()
public void enableProxy()
disableProxy()
public void disableProxy()
enableProxy()
public boolean isProxyEnabled()
true
if the proxy settings are activeenableProxy()
,
disableProxy()
public void disableHTTPSDialog(boolean onOff)
onOff
- true
Disable security warning dialogs.public boolean getHTTPSDialog()
getdisableHTTPSDialog()
public boolean getdisableHTTPSDialog()
public ProxySetting getProxyProtocol(int protocol)
protocol
- Identify which protocol settings to retrieve. Use the ProxySetting protocol flags.
ProxySetting.PROTOCOL_ALL
,
ProxySetting.PROTOCOL_FTP
,
ProxySetting.PROTOCOL_GOPHER
,
ProxySetting.PROTOCOL_HTTP
,
ProxySetting.PROTOCOL_HTTPS
,
ProxySetting.PROTOCOL_SOCKS
public void setProxyProtocol(ProxySetting proxy)
ProxySetting
define a single protocol at a time.
This function only sets the proxy protocol. The proxy needs to be explicitly enabled for it to be active.
proxy
- The proxy settings for a single protocol.enableProxy()
,
disableProxy()
public java.lang.String getProxyBypasses()
public void setProxyBypasses(java.lang.String urls)
The following are some examples:
www.jadeliquid.com
bypasses for the specified URL.
.jadeliquid.com
bypasses the specified domain.
.gnome.org,.kde.org
bypasses gnome.org and kde.org domains.
urls
- Domains that bypass the proxy, as a comma-separated list.public void autoconfigureProxy(java.lang.String url)
url
- URL of proxy automatic configuration setting.public void cancelSave()
public IDocument getDocument()
IDocument
is only valid while the current page is loaded.
This function should not be called until the NetworkEvent onDocumentComplete has fired.
public void allowPopups(boolean bOnOff)
bOnOff
- false
to disable popupsgetAllowPopups()
public boolean getAllowPopups()
true
if popups are enabled for this canvas.allowPopups(boolean)
public boolean getJavascriptEnabled()
true
if Javascript is enabled.setJavascriptEnabled(boolean)
public void setJavascriptEnabled(boolean bOnOff)
BrowserFactory.spawnInternetExplorer()
,
it must be called directly after spawning the browser. A Mozilla canvas created via BrowserFactory.spawnMozilla()
may have Javascript enabled or disabled at anytime, with the effects happening on the next page load.
getJavascriptEnabled()
,
BrowserFactory.spawnInternetExplorer()
,
BrowserFactory.spawnMozilla()
public History getHistory()
Example:
History h = browser.getHistory();
for ( int i = 0; i < h.length(); i++ )
System.out.println( "Page " + i + " URL = " + h.getPageAt(i).getURL() );
public void saveToFile(java.lang.String filename)
filename
- The path and name of the file to which the document is to be saved.public void enableDefaultContextMenu(boolean onOff)
onOff
- Set to true
to display the context menu on right mouse click.getDefaultContextMenuStatus()
public boolean getDefaultContextMenuStatus()
true
if context menu is enabled.enableDefaultContextMenu(boolean)
public boolean getHTMLEditingMode()
setHTMLEditingMode(boolean)
Default is false
public boolean getPopupParentWindow()
IBrowserCanvas
Default is false
public java.lang.String[] getPrinterNames()
public void setHTMLEditingMode(boolean onOff)
By default this is set to false.
This function is currently not available on a ISafariBrowserCanvas
onOff
- set to true to enable editing modepublic void EventsFireStatus(boolean onOff)
onOff
- true to block eventspublic boolean getStatusBar()
public boolean isScrollBarsVisible()
public void loadURL(int NavConstants, java.lang.String strURL, byte[] POSTData, java.lang.String TargetFrameName, java.lang.String Headers)
NavConstants
- strURL
- POSTData
- TargetFrameName
- Headers
- public void openFileWithApp(java.lang.String strLocalPath, java.lang.String strAppPath)
strLocalPath
- strAppPath
- public void paste()
setHTMLEditingMode(true)
has been
called on the IBrowserCanvas
public void print(int Options)
Options
- The following values allowed:
PRINT_DEFAULT_ACTION
Default printing actionPRINT_SHOW_DIALOG_BOX
Show print dialog box.PRINT_SILENT
Don't show print dialog box.PRINT_SILENT_SHOW_HELP
Show help.public void print(int Options, java.lang.String PrinterName)
Options
- The following values allowed:
PRINT_DEFAULT_ACTION
Default printing actionPRINT_SHOW_DIALOG_BOX
Show print dialog box.PRINT_SILENT
Don't show print dialog box.PRINT_SILENT_SHOW_HELP
Show help.PrinterName
- Should be a printer name String returned from getPrinterNames()
public int printPreview()
IBrowserCanvas
a print preview of the current page
To leave print preview mode, call this method again.
public int savePageToBitmapImage(java.lang.String strLocalFileName, boolean full)
strLocalFileName
- Full path to the new image file.full
- -- true - saves whole page
-- false - only visible part of page
IE specifics:
Generates single PNG file
Mozilla specifics:
Generates single/multiple PNG file(s)
If the page being saved contains frames, then for each frame there is generated a separate image file
which has a modified filename with an appended suffix _Frame#, with # replaced by the zero-based index
of the frame.public void setPopupParentWindow(boolean bOnOff)
bOnOff
- public void showScrollBars(boolean bShow)
bShow
- true
to display native scrollbarspublic void useDefaultProfile(boolean bTrue)
bTrue
- Default value: false
Note: This is an initialization function that should only be be called before browser widget creation.public void setPrefProperty(java.lang.String pref, boolean onOff)
pref
- The property to set.onOff
- The value to set it to.public void setPrefProperty(java.lang.String pref, int intPref)
pref
- The property to set.intPref
- The value to set it to.public void setPrefProperty(java.lang.String pref, java.lang.String stringPref)
pref
- The property to set.stringPref
- The value to set it to.public void addBrowserListener(BrowserListener listener)
listener
is null
, no exception is
thrown and no action is performed.
listener
- The browser listener to add.removeBrowserListener(BrowserListener)
public void addJavascriptListener(JavascriptListener listener)
listener
is null
, no
exception is thrown and no action is performed.
listener
- The Javascript listener to add.removeJavascriptListener(JavascriptListener)
public void addNetworkListener(NetworkListener listener)
listener
is null
, no
exception is thrown and no action is performed.
listener
- The network listener to add.removeNetworkListener(NetworkListener)
public void addMouseListener(MouseListener listener)
listener
is null
, no
exception is thrown and no action is performed.
listener
- The mouse listener to add.removeMouseListener(MouseListener)
public void addKeyListener(KeyListener listener)
listener
is null
, no
exception is thrown and no action is performed.
listener
- The Key listener to add.removeKeyListener(KeyListener)
public void addPrintListener(PrintListener listener)
listener
is null, no exception is thrown and no action is performed.
listener
- The print listener to add.removePrintListener(PrintListener)
public void addWindowListener(WindowListener listener)
WindowListener
attached, the IBrowserCanvas
will no longer automatically spawn popup windows.
listener
- The window listener to add.removeWindowListener(WindowListener)
public void addPromptListener(PromptListener listener)
listener
- the prompt listener to add.removePromptListener(com.webrenderer.event.PromptListener)
public void removeWindowListener(WindowListener listener)
listener
- the listener to remove.addWindowListener(WindowListener)
public void removePrintListener(PrintListener listener)
listener
- the listener to remove.addPrintListener(PrintListener)
public void removeBrowserListener(BrowserListener listener)
listener
is null, or listener
has not been previously added as
a listener, no exception is thrown and no action is performed.
- Parameters:
listener
- The browser listener- See Also:
addBrowserListener(BrowserListener)
public void removeJavascriptListener(JavascriptListener listener)
listener
is null, or listener
has not been previously added as
a listener, no exception is thrown and no action is performed.
- Parameters:
listener
- The Javascript listener- See Also:
addJavascriptListener(JavascriptListener)
public void removeNetworkListener(NetworkListener listener)
listener
is null, or listener
has not
been previously added as a listener, no exception is thrown and no action
is performed.
- Parameters:
listener
- The network listener- See Also:
addNetworkListener(NetworkListener)
public void removeMouseListener(MouseListener listener)
listener
is null, or listener
has not been previously added as
a listener, no exception is thrown and no action is performed.
- Parameters:
listener
- The mouse listener- See Also:
addMouseListener(MouseListener)
public void removeKeyListener(KeyListener listener)
listener
is null, or listener
has not been previously added as
a listener, no exception is thrown and no action is performed.
- Parameters:
listener
- The Keyboard listener to remove.- See Also:
addKeyListener(KeyListener)
public void removePromptListener(PromptListener listener)
listener
is null, or listener
has not been previously added as
a listener, no exception is thrown and no action is performed.
- Parameters:
listener
- The Prompt listener to remove.- See Also:
addPrintListener(PrintListener)
public void executeScript(java.lang.String javascriptBody)
javascriptBody
- The script to run.NetworkListener
,
addNetworkListener(NetworkListener)
,
setJavascriptEnabled(boolean)
public java.lang.String executeScriptWithReturn(java.lang.String javascriptBody)
Returns the result of executing this script as a string
e.g: executing the following script:
" var myVariable='hello';myVariable;"
Will return the string "hello"
javascriptBody
- The script to runNetworkListener
,
addNetworkListener(NetworkListener)
,
setJavascriptEnabled(boolean)
public void httpPOST(java.lang.String strURL, java.lang.String POSTData)
strURL
- POSTData
- public void httpPOST(java.lang.String strURL, java.io.File file, java.lang.String fileVariableName, java.lang.String additionalPOSTData)
strURL
- file
- fileVariableName
- additionalPOSTData
- public void httpPOST(java.lang.String strURL, java.io.File file, java.lang.String fileVariableName)
strURL
- file
- fileVariableName
- public boolean getBoolPrefProperty(java.lang.String propName)
propName
- the name of the property to retrieve.
public int getIntPrefProperty(java.lang.String propName)
propName
- the name of the property to retrieve.
public java.lang.String getStringPrefProperty(java.lang.String propName)
propName
- the name of the property to retrieve.
public void setPreferredSize(int width, int height)
width
- preferred width.height
- preferred height.getPreferredSize()
public java.awt.Dimension getPreferredSize()
setPreferredSize(int, int)
public boolean isCacheDisabled()
true
indicates the cache is disabled.public void disableCache()
BrowserFactory.spawnInternetExplorer()
it must be called directly after spawning the browser. The spawnMozilla version of the method can be
called anytime with the effects happening on the next page load.
enableCache()
public void enableCache()
BrowserFactory.spawnInternetExplorer()
it must be called directly after spawning the browser. The spawnMozilla version of the method can be
called anytime with the effects happening on the next page load.
disableCache()
public void addBlockedURL(java.lang.String strURL)
strURL
- full URL to add to blocked list.removeBlockedURL(String)
public void removeBlockedURL(java.lang.String strURL)
strURL
- full URL to remove from blocked list.addBlockedURL(String)
public void addDOMListener(DOMListener listener)
listener
- The DOM listener to add.removeDOMListener(com.webrenderer.event.DOMListener)
public void removeDOMListener(DOMListener listener)
listener
- the DOM listener to remove.addDOMListener(DOMListener)
public java.lang.String getSelectedText()
public void destroy()
BrowserFactory.destroyBrowser(IBrowserCanvas)
public void highlightSelectedText(java.awt.Color colour)
colour
- the colour to use for highlighting.public void enableJInternalFrame(javax.swing.JInternalFrame parent)
parent
- the JInternalFrame that the browser is to be added to.disableJInternalFrame()
public void disableJInternalFrame()
enableJInternalFrame(javax.swing.JInternalFrame)
public void enableCookies()
disableCookies()
public void disableCookies()
enableCookies()
public boolean isCookiesEnabled()
true
if cookies feature is enabled.disableCookies()
,
enableCookies()
public java.lang.String makeImageUrl(java.awt.image.BufferedImage img)
img
- the image.
removeImage(String)
public void removeImage(java.lang.String imageID)
imageID
- the image ID.makeImageUrl(java.awt.image.BufferedImage)
public java.awt.image.BufferedImage saveToBufferedImage(boolean bWholePage)
bWholePage
- if true returns the whole page not just what is visible
public java.awt.image.BufferedImage saveToBufferedImage(boolean bWholePage, boolean bKeepAlpha)
bWholePage
- if true returns the whole page not just what is visible
public void disableClipping(boolean bDisable)
bDisable
- true
to turn off clipping.isDisableClipping()
public boolean isDisableClipping()
disableClipping(boolean)
public void grabFocus()
public java.lang.String getCookie(java.lang.String URL)
URL
-
getCookie()
,
setCookie(String)
,
setCookie(String, String)
public java.lang.String getCookie()
getCookie(String)
,
setCookie(String)
,
setCookie(String, String)
public void setCookie(java.lang.String Value)
Value
- the cookie value.getCookie(String)
public void setCookie(java.lang.String URL, java.lang.String Value)
URL
- the domain for the cookie.Value
- the value for the cookie.getCookie(String)
public void deleteCookies()
public void sendKeyPressToElement(int keyCode, int modifiers)
keyCode
- A key code, selected from the KEY_CODE constants.modifiers
- A key modifier, selected from the KEY_MODIFIER constants.KEY_CODE_BACKSPACE
,
KEY_CODE_DELETE
,
KEY_CODE_TAB
,
KEY_MODIFIER_CTRL_DOWN
,
KEY_MODIFIER_SHIFT_DOWN
public IElement getElementAtCaretPosition(boolean returnTextNodes)
returnTextNodes
- When called on an IMozillaBrowserCanvas
setting this to true will return the text node the cursor is on,
otherwise the parent tag.
This parameter is ignored if not called on an IMozillaBrowserCanvas
.
null
.setHTMLEditingMode(boolean)
public void setPrintPageOrientation(int orientation)
orientation
- either portrait or landscape.PRINT_ORIENTATION_PORTRAIT
,
PRINT_ORIENTATION_LANDSCAPE
public void increaseTextZoom()
public void decreaseTextZoom()
public boolean setHomeDirectory(java.lang.String newDirectory)
newDirectory
- the writeable directory to use for WebRenderer transient storage.
public java.lang.String getHomeDirectory()
public void insertHTML(java.lang.String strHTMLText)
strHTMLText
- setHTMLEditingMode(boolean)
public void registerProtocol(java.lang.String protocol, ProtocolListener l)
protocol
- name of protocol to create or overridel
- listener to implement protocolpublic java.awt.Dimension getPageSize()
public void enableImageLoading(boolean enable)
enable
- true to load images, false to disable them. This is true by default.public ScrollBarInfo getScrollBarInfo()
public void scrollToY(int yPos)
yPos
- Y position of the scroll.public void scrollToX(int xPos)
xPos
- X position of the scroll.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |