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.showModalDialogorwindow.showModelessDialog.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDialogWindow(WebClient webClient, java.lang.Object arguments)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this window.WebWindowgetParentWindow()Returns the window that contains this window.WebWindowgetTopWindow()Returns the top level window that contains this window.protected booleanisJavaScriptInitializationNeeded(Page page)Returnstrueif this window needs JavaScript initialization to occur when the enclosed page is set.<T> 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.StringtoString()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 thedialogArgumentsJavaScript property
-
-
Method Detail
-
isJavaScriptInitializationNeeded
protected boolean isJavaScriptInitializationNeeded(Page page)
Returnstrueif this window needs JavaScript initialization to occur when the enclosed page is set.- Specified by:
isJavaScriptInitializationNeededin classWebWindowImpl- Parameters:
page- the page that will become the enclosing page- Returns:
trueif 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> 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:
setScriptableObjectin interfaceWebWindow- Overrides:
setScriptableObjectin 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:
toStringin classjava.lang.Object- Returns:
- a string representation of this object
-
-