com.jniwrapper.win32.ie.event
Interface WebBrowserEventsHandler

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
DefaultWebBrowserEventsHandler

public interface WebBrowserEventsHandler
extends java.util.EventListener

Handler of events from the browser object.

For affecting browser behaviour each method of the handler returns value or modify output parameters.

See Also:
DWebBrowserEvents2

Method Summary
 boolean beforeFileDownload()
          Invoked before displaying file download dialog.
 boolean beforeNavigate(WebBrowser webBrowser, java.lang.String url, java.lang.String targetFrameName, java.lang.String postData, java.lang.String headers)
          Invoked before navigation operation in the browser (without opening new window).
 java.awt.Dimension clientAreaSizeRequested(java.awt.Dimension clientAreaSize)
          Invoked when requesting size of client area for the browser.
 boolean navigationErrorOccured(WebBrowser webBrowser, java.lang.String url, java.lang.String frame, StatusCode statusCode)
          Invoked when navigation error has been occured.
 boolean windowClosing(boolean isChildWindow)
          This event is fired when a window is closed from script, by using the window.close method.
 

Method Detail

beforeNavigate

boolean beforeNavigate(WebBrowser webBrowser,
                       java.lang.String url,
                       java.lang.String targetFrameName,
                       java.lang.String postData,
                       java.lang.String headers)
Invoked before navigation operation in the browser (without opening new window).

You can cancel navigation using return value.

Parameters:
webBrowser - web browser where navigation occurs
url - url to navigate
targetFrameName - name of frame to display resource
postData - data to send to the server if used HTTP POST method
headers - additional http headers to send to the server
Returns:
false if proceed or true if cancel navigation

beforeFileDownload

boolean beforeFileDownload()
Invoked before displaying file download dialog.

Returns:
false if proceed, or true if cancel download process

windowClosing

boolean windowClosing(boolean isChildWindow)
This event is fired when a window is closed from script, by using the window.close method. User can cancel closing of the window using return value.

Parameters:
isChildWindow - is child window.
Returns:
false specifies whether the window is prevented from closing. Return false when window is allowed to close, otherwise - true.

clientAreaSizeRequested

java.awt.Dimension clientAreaSizeRequested(java.awt.Dimension clientAreaSize)
Invoked when requesting size of client area for the browser.

Parameters:
clientAreaSize - requested size of client area
Returns:
passed parameter or null if don't modify client area size

navigationErrorOccured

boolean navigationErrorOccured(WebBrowser webBrowser,
                               java.lang.String url,
                               java.lang.String frame,
                               StatusCode statusCode)
Invoked when navigation error has been occured.

You can cancel redirection to error page using return value.

Parameters:
webBrowser - web browser where navigation occurs
url - url for which navigation failed
frame - name of frame
statusCode - http status code or HResult
Returns:
false if continue navigation to error page (default) else return true