## com.gargoylesoftware.htmlunit
Class DialogWindow

    java.lang.Object
      com.gargoylesoftware.htmlunit.WebWindowImpl
          com.gargoylesoftware.htmlunit.DialogWindow

All Implemented Interfaces:
  WebWindow, java.io.Serializable

    public class DialogWindow

extends WebWindowImpl

A window opened in JavaScript via either `window.showModalDialog` or `window.showModelessDialog`.

Version:
  $Revision: 4756 $
Author:
  Daniel Gredler
See Also:
  Serialized Form

Constructor Summary
`DialogWindow(WebClient webClient, java.lang.Object arguments)` Creates a new instance.

Method Summary
`void` `close()` Closes this window.
`WebWindow` `getParentWindow()` Returns the window that contains this window.
`WebWindow` `getTopWindow()` Returns the top level window that contains this window.
`protected boolean` `isJavaScriptInitializationNeeded()` Returns `true` if this window needs JavaScript initialization to occur when the enclosed page is set.
`void` `setScriptObject(java.lang.Object scriptObject)` INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Sets the JavaScript object that corresponds to this element.

Methods inherited from class com.gargoylesoftware.htmlunit.WebWindowImpl
`addChildWindow, getEnclosedPage, getHistory, getJobManager, getName, getScriptObject, getWebClient, performRegistration, setEnclosedPage, setJobManager, setName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DialogWindow

    public DialogWindow(WebClient webClient,
                        java.lang.Object arguments)

  Creates a new instance.

  Parameters:
    `webClient` - the web client that "owns" this window
    `arguments` - the arguments object exposed via the `dialogArguments` JavaScript property

Method Detail

### 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

### getParentWindow

    public WebWindow getParentWindow()

  Returns the window that contains this window. If this is a top level window, then return this window.

  Returns:
    the parent window or this window if there is no parent

### getTopWindow

    public WebWindow getTopWindow()

  Returns the top level window that contains this window. If this is a top level window, then return this window.

  Returns:
    the top level window that contains this window or this window if there is no parent.

### setScriptObject

    public void setScriptObject(java.lang.Object scriptObject)

  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Sets the JavaScript object that corresponds to this element. This is not guaranteed to be set even if there is a JavaScript object for this HTML element.

  Specified by:
    `setScriptObject` in interface `WebWindow`
  Overrides:
    `setScriptObject` in class `WebWindowImpl`
  Parameters:
    `scriptObject` - the JavaScript object

### close

    public void close()

  Closes this window.

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