public abstract class NetworkAdapter extends Object implements NetworkListener
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 and Description |
---|
NetworkAdapter() |
Modifier and Type | Method and Description |
---|---|
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 when before a 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.
|
public void onHTTPInterceptHeaders(NetworkEvent e)
NetworkListener
IBrowserCanvas
when before a HTTP request is sent.
Using this event you can modify the HTTP Request Headers before the request is sent.
onHTTPInterceptHeaders
in interface NetworkListener
public void onProgressChange(NetworkEvent e)
NetworkListener
onProgressChange
in interface NetworkListener
public void onDocumentLoad(NetworkEvent e)
NetworkListener
onDocumentLoad
in interface NetworkListener
public void onDocumentComplete(NetworkEvent e)
NetworkListener
onDocumentComplete
in interface NetworkListener
public void onNetworkStatus(NetworkEvent e)
NetworkListener
onNetworkStatus
in interface NetworkListener
public void onNetworkError(NetworkEvent e)
NetworkListener
onNetworkError
in interface NetworkListener
public void onHTTPResponse(NetworkEvent e)
NetworkListener
IMozillaBrowserCanvas
when Http Response data is sent back from a request.
onHTTPResponse
in interface NetworkListener