com.gargoylesoftware.htmlunit
Class TopLevelWindow

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.WebWindowImpl
      extended by com.gargoylesoftware.htmlunit.TopLevelWindow
All Implemented Interfaces:
WebWindow, Serializable

public class TopLevelWindow
extends WebWindowImpl
implements Serializable

A window representing a top level browser window.

Version:
$Revision: 2132 $
Author:
Mike Bowler, David K. Taylor, David D. Kilzer, Ahmed Ashour
See Also:
Serialized Form

Constructor Summary
TopLevelWindow(String name, WebClient webClient)
          Create an instance.
 
Method Summary
 void close()
          Close this window.
 WebWindow getOpener()
          Return the opener property.
 WebWindow getParentWindow()
          Return the window that contains this window. Since this is a top level window, return this window.
 WebWindow getTopWindow()
          Return the top level window that contains this window. Since this is a top level window, return this window.
protected  boolean isJavaScriptInitializationNeeded()
          Returns true if this window needs JavaScript initialization to occur when the enclosed page is set.
 void setOpener(WebWindow opener)
          Set the opener property.
 String toString()
          Return a string representation of this object
 
Methods inherited from class com.gargoylesoftware.htmlunit.WebWindowImpl
addChildWindow, getEnclosedPage, getName, getScriptObject, getThreadManager, getWebClient, performRegistration, setEnclosedPage, setName, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TopLevelWindow

public TopLevelWindow(String name,
                      WebClient webClient)
Create an instance.

Parameters:
name - The name of the new window
webClient - The web client that "owns" this window.
Method Detail

getParentWindow

public WebWindow getParentWindow()
Return the window that contains this window. If this is a top level window, then return this window. Since this is a top level window, return this window.

Specified by:
getParentWindow in interface WebWindow
Returns:
The parent window or this window if there is no parent.

getTopWindow

public WebWindow getTopWindow()
Return the top level window that contains this window. If this is a top level window, then return this window. Since this is a top level window, return this window.

Specified by:
getTopWindow in interface WebWindow
Returns:
The top level window that contains this window or this window if there is no parent.

isJavaScriptInitializationNeeded

protected boolean isJavaScriptInitializationNeeded()
Returns true if this window needs JavaScript initialization to occur when the enclosed page is set.

Specified by:
isJavaScriptInitializationNeeded in class WebWindowImpl
Returns:
true if this window needs JavaScript initialization to occur when the enclosed page is set

toString

public String toString()
Return a string representation of this object

Overrides:
toString in class Object
Returns:
A string representation of this object

setOpener

public void setOpener(WebWindow opener)
Set the opener property. This is the WebWindow that caused this new window to be opened.

Parameters:
opener - The new opener

getOpener

public WebWindow getOpener()
Return the opener property. This is the WebWindow that caused this new window to be opened.

Returns:
The opener

close

public void close()
Close this window.



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