Package org.htmlunit

Class DialogWindow

  • All Implemented Interfaces:
    java.io.Serializable, WebWindow

    public class DialogWindow
    extends WebWindowImpl
    A window opened in JavaScript via either window.showModalDialog or window.showModelessDialog.
    See Also:
    Serialized Form
    • Constructor Detail

      • DialogWindow

        protected 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​(Page page)
        Returns true if this window needs JavaScript initialization to occur when the enclosed page is set.
        Specified by:
        isJavaScriptInitializationNeeded in class WebWindowImpl
        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 interface WebWindow
        Overrides:
        setScriptableObject in class WebWindowImpl
        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 class java.lang.Object
        Returns:
        a string representation of this object