public abstract class ProtocolEvent extends EventObject
ProtocolEvent will
be invoked in an IMozillaBrowserCanvas .
This event object contains callback methods to pass data back to the underlying browser about a protocol load. For an example of using ProtocolEvent see Protocol Listener.
| Modifier and Type | Field and Description |
|---|---|
static int |
REQUEST_FAILED
The load has finished but something has failed.
|
static int |
REQUEST_OK
The load has finished and everything has been successful.
|
source| Modifier | Constructor and Description |
|---|---|
protected |
ProtocolEvent(Object source,
String url)
Constructor for ProtocolEvent with a source.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getURL()
Returns the URL.
|
abstract void |
onDataAvailable(byte[] data)
Passes some data to the underlying browser.
|
abstract void |
onStartRequest(String contentType)
Tell the underlying browser that the load is about to begin.
|
abstract void |
onStopRequest(int result)
Tell the underlying browser that all the data has been sent.
|
getSource, toStringpublic static final int REQUEST_OK
public static final int REQUEST_FAILED
protected ProtocolEvent(Object source, String url)
source - EventObject.EventObject(Object)public abstract void onStartRequest(String contentType)
contentType - the content type of the data that is about to be sent.
e.g. "text/html", or "image/gif" etc.public abstract void onStopRequest(int result)
result - result of load. Can either be REQUEST_OK or REQUEST_FAILEDREQUEST_OK,
REQUEST_FAILEDpublic abstract void onDataAvailable(byte[] data)
data - byte array containing data.public String getURL()