com.gargoylesoftware.htmlunit
Class WebWindowEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.gargoylesoftware.htmlunit.WebWindowEvent
All Implemented Interfaces:
Serializable

public final class WebWindowEvent
extends EventObject

An event that will be fired when a WebWindow changes.

Version:
$Revision: 5301 $
Author:
Mike Bowler, David K. Taylor
See Also:
Serialized Form

Field Summary
static int CHANGE
          The content of the window has changed.
static int CLOSE
          A window has closed.
static int OPEN
          A window has opened.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
WebWindowEvent(WebWindow webWindow, int type, Page oldPage, Page newPage)
          Creates an instance.
 
Method Summary
 boolean equals(Object object)
          Returns true if the two objects are equal.
 int getEventType()
           
 Page getNewPage()
          Returns the oldPage.
 Page getOldPage()
          Returns the oldPage.
 WebWindow getWebWindow()
          Returns the web window that fired the event.
 int hashCode()
          Returns the hash code for this object.
 String toString()
          Returns a string representation of this event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OPEN

public static final int OPEN
A window has opened.

See Also:
Constant Field Values

CLOSE

public static final int CLOSE
A window has closed.

See Also:
Constant Field Values

CHANGE

public static final int CHANGE
The content of the window has changed.

See Also:
Constant Field Values
Constructor Detail

WebWindowEvent

public WebWindowEvent(WebWindow webWindow,
                      int type,
                      Page oldPage,
                      Page newPage)
Creates an instance.

Parameters:
webWindow - the WebWindow that caused the event
type - the type - one of OPEN, CLOSE or CHANGE
oldPage - the old contents of the web window
newPage - the new contents of the web window
Method Detail

equals

public boolean equals(Object object)
Returns true if the two objects are equal.

Overrides:
equals in class Object
Parameters:
object - the object to compare against
Returns:
true if the two objects are equal

hashCode

public int hashCode()
Returns the hash code for this object.

Overrides:
hashCode in class Object
Returns:
the hash code for this object

getOldPage

public Page getOldPage()
Returns the oldPage.

Returns:
the page or null if the window has no page

getNewPage

public Page getNewPage()
Returns the oldPage.

Returns:
the page or null if the window has no page

getWebWindow

public WebWindow getWebWindow()
Returns the web window that fired the event.

Returns:
the web window that fired the event

toString

public String toString()
Returns a string representation of this event.

Overrides:
toString in class EventObject
Returns:
a string representation of this event

getEventType

public int getEventType()
Returns:
the event type


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.