com.webrenderer.se.event
Class BrowserEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.webrenderer.se.event.BrowserEvent
All Implemented Interfaces:
java.io.Serializable

public class BrowserEvent
extends java.util.EventObject

An event which indicates that there has been a change in some areas of the browser. Currently, a BrowserEvent encapsulates:

To reduce the cost of multiple method invocations, the event object will record the new data pertaining to the event. The object will only contain the data required for the given event. This implies that if the event was generated due to a URL change, then the title and link information will be invalid.

If a function is not appropriate/available for the situation from which it is being called, it will return null.

To clarify the meaning of a link message, these occur when the users mouse passes over a HTML link. The message passed back is usually the url the link is pointing to, unless modified via scripting.

See Also:
BrowserListener, Serialized Form

Field Summary
protected  java.lang.String headers
           
protected  java.lang.String link
           
protected  java.lang.String postData
           
protected  boolean result
           
protected  java.lang.String targetFrame
           
protected  java.lang.String title
           
protected  int transactionId
           
protected  java.lang.String url
           
protected  int x
           
protected  int y
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BrowserEvent(java.lang.Object source)
          Constructor for BrowserEvent with a source.
 
Method Summary
 void blockLoad()
          Set a flag to block loading.
 boolean getBlockLoad()
          Get the current block status.
 java.lang.String getHeaders()
          Gets the request headers.
 java.lang.String getLink()
          Gets the link message.
 java.lang.String getPOSTData()
          Gets the post data.
 java.lang.String getTargetFrame()
          Get the target frame name.
 java.lang.String getTitle()
          Get the title.
 int getTransactionId()
          Get the transaction ID.
 java.lang.String getURL()
          Get the URL.
 int getX()
          Get the X-position of the event.
 int getY()
          Get the Y-position of the event.
 void setHeaders(java.lang.String string)
          Set the request headers.
 void setLink(java.lang.String link)
          Set the link message.
 void setPOSTData(java.lang.String string)
           
 void setTargetFrame(java.lang.String string)
          Set the name of the target frame.
 void setTitle(java.lang.String title)
          Set the title.
 void setTransactionId(int i)
          Set the transaction ID.
 void setURL(java.lang.String url)
          Set the URL.
 void setX(int x)
          Sets the X-position of the event.
 void setY(int y)
          Sets the Y-position of the event.
 void unBlockLoad()
          Unblock the loading.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transactionId

protected int transactionId

result

protected boolean result

url

protected java.lang.String url

title

protected java.lang.String title

link

protected java.lang.String link

headers

protected java.lang.String headers

postData

protected java.lang.String postData

targetFrame

protected java.lang.String targetFrame

x

protected int x

y

protected int y
Constructor Detail

BrowserEvent

public BrowserEvent(java.lang.Object source)
Constructor for BrowserEvent with a source. The URL, title, and link fields are initialised to null.

Parameters:
source -
See Also:
EventObject.EventObject(Object)
Method Detail

getURL

public java.lang.String getURL()
Get the URL.

Returns:
the URL or null

see availability of return values in BrowserListener

See Also:
getURL()

setURL

public void setURL(java.lang.String url)
Set the URL. This should only be used for constructing new events.

Parameters:
url - The URL.
See Also:
getURL()

getTitle

public java.lang.String getTitle()
Get the title.

Returns:
the title, or null.

see availability of return values in BrowserListener

See Also:
setTitle(String)

setTitle

public void setTitle(java.lang.String title)
Set the title. This should only be used for constructing new events.

Parameters:
title - The title.

getLink

public java.lang.String getLink()
Gets the link message.

Returns:
the link message, or null

see availability of return values in BrowserListener


getPOSTData

public java.lang.String getPOSTData()
Gets the post data.

Returns:
the post data, or null

see availability of return values in BrowserListener


getHeaders

public java.lang.String getHeaders()
Gets the request headers.

Returns:
the request headers, or null

see availability of return values in BrowserListener


setLink

public void setLink(java.lang.String link)
Set the link message. This should only be used for constructing new events.

Parameters:
link - The link message.

getTargetFrame

public java.lang.String getTargetFrame()
Get the target frame name.

Returns:
the Target Frame Name

blockLoad

public void blockLoad()
Set a flag to block loading. When called from onLoadIntercept allows the stop of a load before it starts

See Also:
unBlockLoad()

unBlockLoad

public void unBlockLoad()
Unblock the loading.

See Also:
blockLoad()

getBlockLoad

public boolean getBlockLoad()
Get the current block status.

Returns:
the current status of load blocking.
See Also:
unBlockLoad(), blockLoad()

setHeaders

public void setHeaders(java.lang.String string)
Set the request headers.

Parameters:
string - the new request headers.

setPOSTData

public void setPOSTData(java.lang.String string)
Parameters:
string -

setTargetFrame

public void setTargetFrame(java.lang.String string)
Set the name of the target frame.

Parameters:
string - the target frame.

getX

public int getX()
Get the X-position of the event.

Returns:
int X-position of the event.

getY

public int getY()
Get the Y-position of the event.

Returns:
int Y-position of the event.

setX

public void setX(int x)
Sets the X-position of the event.

Parameters:
x - The X-position of the event.

setY

public void setY(int y)
Sets the Y-position of the event.

Parameters:
y - The Y-position of the event.

getTransactionId

public int getTransactionId()
Get the transaction ID. Used to link a BrowserEvent.onBeforeNavigate to a NetowrkEvent.onHTTPResponse

Returns:
Transaction ID
See Also:
setTransactionId(int)

setTransactionId

public void setTransactionId(int i)
Set the transaction ID.

Parameters:
i - the transaction ID.
See Also:
getTransactionId()