Package org.htmlunit
Class DialogWindow
- java.lang.Object
-
- org.htmlunit.WebWindowImpl
-
- org.htmlunit.DialogWindow
-
- All Implemented Interfaces:
java.io.Serializable
,WebWindow
public class DialogWindow extends WebWindowImpl
A window opened in JavaScript via eitherwindow.showModalDialog
orwindow.showModelessDialog
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DialogWindow(WebClient webClient, java.lang.Object arguments)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(Page page)
Returnstrue
if this window needs JavaScript initialization to occur when the enclosed page is set.<T extends org.htmlunit.javascript.HtmlUnitScriptable>
voidsetScriptableObject(T scriptObject)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Sets the JavaScript object that corresponds to this element.java.lang.String
toString()
Returns a string representation of this object.-
Methods inherited from class org.htmlunit.WebWindowImpl
addChildWindow, destroyChildren, getComputedStyle, getEnclosedPage, getHistory, getInnerHeight, getInnerWidth, getJobManager, getName, getOuterHeight, getOuterWidth, getScreen, getScriptableObject, getWebClient, isClosed, performRegistration, removeChildWindow, setClosed, setEnclosedPage, setInnerHeight, setInnerWidth, setJobManager, setName, setOuterHeight, setOuterWidth
-
-
-
-
Constructor Detail
-
DialogWindow
protected DialogWindow(WebClient webClient, java.lang.Object arguments)
Creates a new instance.- Parameters:
webClient
- the web client that "owns" this windowarguments
- the arguments object exposed via thedialogArguments
JavaScript property
-
-
Method Detail
-
isJavaScriptInitializationNeeded
protected boolean isJavaScriptInitializationNeeded(Page page)
Returnstrue
if this window needs JavaScript initialization to occur when the enclosed page is set.- Specified by:
isJavaScriptInitializationNeeded
in classWebWindowImpl
- Parameters:
page
- the page that will become the enclosing page- 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.
-
setScriptableObject
public <T extends org.htmlunit.javascript.HtmlUnitScriptable> void setScriptableObject(T 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:
setScriptableObject
in interfaceWebWindow
- Overrides:
setScriptableObject
in classWebWindowImpl
- Type Parameters:
T
- the object type- Parameters:
scriptObject
- the JavaScript object
-
close
public void close()
Closes this window.
-
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this object
-
-