Package org.htmlunit

Interface WebWindow

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    DialogWindow, FrameWindow, TopLevelWindow, WebWindowImpl

    public interface WebWindow
    extends java.io.Serializable
    An interface that represents one window in a browser. It could be a top level window or a frame.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.htmlunit.css.ComputedCssStyleDeclaration getComputedStyle​(DomElement element, java.lang.String pseudoElement)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns computed style of the element.
      Page getEnclosedPage()
      Returns the currently loaded page or null if no page has been loaded.
      History getHistory()
      Returns this window's navigation history.
      int getInnerHeight()
      Returns the height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
      int getInnerWidth()
      Returns the width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
      org.htmlunit.javascript.background.JavaScriptJobManager getJobManager()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns the job manager for this window.
      java.lang.String getName()
      Returns the name of this window.
      int getOuterHeight()
      Returns the height in pixels of the whole browser window.
      int getOuterWidth()
      Returns the width of the outside of the browser window.
      WebWindow getParentWindow()
      Returns the window that contains this window.
      Screen getScreen()  
      <T> T getScriptableObject()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns the JavaScript object that corresponds to this element.
      WebWindow getTopWindow()
      Returns the top level window that contains this window.
      WebClient getWebClient()
      Returns the web client that "owns" this window.
      boolean isClosed()
      Indicates if this window is closed.
      void setEnclosedPage​(Page page)
      Sets the currently loaded page.
      void setInnerHeight​(int innerHeight)
      Sets the height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
      void setInnerWidth​(int innerWidth)
      Sets the width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
      void setName​(java.lang.String name)
      Sets the name of this window.
      void setOuterHeight​(int outerHeight)
      Sets the height in pixels of the whole browser window.
      void setOuterWidth​(int outerWidth)
      Sets the width of the outside of the browser window.
      <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.
    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name of this window.
        Returns:
        the name of this window
      • setName

        void setName​(java.lang.String name)
        Sets the name of this window.
        Parameters:
        name - the new window name
      • getEnclosedPage

        Page getEnclosedPage()
        Returns the currently loaded page or null if no page has been loaded.
        Returns:
        the currently loaded page or null if no page has been loaded
      • setEnclosedPage

        void setEnclosedPage​(Page page)
        Sets the currently loaded page.
        Parameters:
        page - the new page or null if there is no page (ie empty window)
      • getParentWindow

        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

        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.
      • getWebClient

        WebClient getWebClient()
        Returns the web client that "owns" this window.
        Returns:
        the web client or null if this window has been closed
      • getHistory

        History getHistory()
        Returns this window's navigation history.
        Returns:
        this window's navigation history
      • setScriptableObject

        <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.
        Type Parameters:
        T - the object type
        Parameters:
        scriptObject - the JavaScript object
      • getScriptableObject

        <T> T getScriptableObject()
        INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
        Returns the JavaScript object that corresponds to this element.
        Type Parameters:
        T - the object type
        Returns:
        the JavaScript object that corresponds to this element
      • getJobManager

        org.htmlunit.javascript.background.JavaScriptJobManager getJobManager()
        INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
        Returns the job manager for this window.
        Returns:
        the job manager for this window
      • isClosed

        boolean isClosed()
        Indicates if this window is closed. No action should be performed on a closed window.
        Returns:
        true when the window is closed
      • getInnerWidth

        int getInnerWidth()
        Returns the width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
        Returns:
        the inner width.
      • setInnerWidth

        void setInnerWidth​(int innerWidth)
        Sets the width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
        Parameters:
        innerWidth - the inner width
      • getOuterWidth

        int getOuterWidth()
        Returns the width of the outside of the browser window. It represents the width of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.
        Returns:
        the outer width
      • setOuterWidth

        void setOuterWidth​(int outerWidth)
        Sets the width of the outside of the browser window. It represents the width of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.
        Parameters:
        outerWidth - the outer width
      • getInnerHeight

        int getInnerHeight()
        Returns the height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
        Returns:
        a inner height
      • setInnerHeight

        void setInnerHeight​(int innerHeight)
        Sets the height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
        Parameters:
        innerHeight - the inner height
      • getOuterHeight

        int getOuterHeight()
        Returns the height in pixels of the whole browser window. It represents the height of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.
        Returns:
        the outer height
      • setOuterHeight

        void setOuterHeight​(int outerHeight)
        Sets the height in pixels of the whole browser window. It represents the height of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.
        Parameters:
        outerHeight - the outer height
      • getScreen

        Screen getScreen()
        Returns:
        the screen this window belongs to
      • getComputedStyle

        org.htmlunit.css.ComputedCssStyleDeclaration getComputedStyle​(DomElement element,
                                                                      java.lang.String pseudoElement)
        INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
        Returns computed style of the element. Computed style represents the final computed values of all CSS properties for the element. This method's return value is of the same type as that of element.style, but the value returned by this method is read-only.
        Parameters:
        element - the element
        pseudoElement - a string specifying the pseudo-element to match (may be null); e.g. ':before'
        Returns:
        the computed style