com.webrenderer.event
Class NetworkAdapter

java.lang.Object
  extended bycom.webrenderer.event.NetworkAdapter
All Implemented Interfaces:
java.util.EventListener, NetworkListener

public abstract class NetworkAdapter
extends java.lang.Object
implements NetworkListener

An abstract adapter class for receiving network events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Extend this class to create a NetworkEvent listener and override the methods for the events of interest. (If you implement the NetworkListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you only have to define methods for events you care about.)

Create a listener object using the extended class and then register it with a browser using the browser's addNetworkListener method. When a network event occurs, the relevant method in the listener object is invoked and the NetworkEvent is passed to it.


Constructor Summary
NetworkAdapter()
           
 
Method Summary
 void onDocumentComplete(NetworkEvent e)
          Invoked when a document stops loading in a browser.
 void onDocumentLoad(NetworkEvent e)
          Invoked when a document starts loading in a browser.
 void onHTTPInterceptHeaders(NetworkEvent e)
          Invoked from an IBrowserCanvas before an HTTP request is sent.
 void onHTTPResponse(NetworkEvent e)
          Invoked from an IMozillaBrowserCanvas when Http Response data is sent back from a request.
 void onNetworkError(NetworkEvent e)
          Invoked when an error occurs on the network.
 void onNetworkStatus(NetworkEvent e)
          Invoked when the status of the network has changed.
 void onProgressChange(NetworkEvent e)
          Invoked when the progress of a document download changes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkAdapter

public NetworkAdapter()
Method Detail

onHTTPInterceptHeaders

public void onHTTPInterceptHeaders(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked from an IBrowserCanvas before an HTTP request is sent. Using this event you can modify the HTTP Request Headers before the request is sent.
Availble Methods from NetworkEvent at the time this event is fired:

Specified by:
onHTTPInterceptHeaders in interface NetworkListener

onProgressChange

public void onProgressChange(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked when the progress of a document download changes.
Availble Methods from NetworkEvent at the time this event is fired:

Specified by:
onProgressChange in interface NetworkListener

onDocumentLoad

public void onDocumentLoad(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked when a document starts loading in a browser.
Availble Methods from NetworkEvent at the time this event is fired: None

Specified by:
onDocumentLoad in interface NetworkListener

onDocumentComplete

public void onDocumentComplete(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked when a document stops loading in a browser. This may be invoked multiple times if a page has frames.
Availble Methods from NetworkEvent at the time this event is fired: e.getURL()

Specified by:
onDocumentComplete in interface NetworkListener

onNetworkStatus

public void onNetworkStatus(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked when the status of the network has changed.
Availble Methods from NetworkEvent at the time this event is fired:

Specified by:
onNetworkStatus in interface NetworkListener

onNetworkError

public void onNetworkError(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked when an error occurs on the network.
Availble Methods from NetworkEvent at the time this event is fired:

Specified by:
onNetworkError in interface NetworkListener

onHTTPResponse

public void onHTTPResponse(NetworkEvent e)
Description copied from interface: NetworkListener
Invoked from an IMozillaBrowserCanvas when Http Response data is sent back from a request.
Availble Methods from NetworkEvent at the time this event is fired:
Note: This will not get fired from an IIEBrowserCanvas (an IBrowserCanvas created from BrowserFactory.spawnInternetExplorer)

Specified by:
onHTTPResponse in interface NetworkListener