Package org.htmlunit.html
Class FrameWindow
- java.lang.Object
-
- org.htmlunit.WebWindowImpl
-
- org.htmlunit.html.FrameWindow
-
- All Implemented Interfaces:
java.io.Serializable
,WebWindow
public class FrameWindow extends WebWindowImpl
The web window for a frame or iframe.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FrameWindow.PageDenied
The different deny states.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this frame window.HtmlPage
getEnclosingPage()
Returns the HTML page in which the <frame> or <iframe> tag is contained for this frame window.BaseFrameElement
getFrameElement()
Gets the DOM node of the (i)frame containing this window.java.lang.String
getName()
Returns the name of this window.FrameWindow.PageDenied
getPageDenied()
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.void
setEnclosedPage(Page page)
Sets the currently loaded page.void
setName(java.lang.String name)
Sets the name of this window.void
setPageDenied(FrameWindow.PageDenied pageDenied)
Marks that the page content as denied.java.lang.String
toString()
Gives a basic representation for debugging purposes.-
Methods inherited from class org.htmlunit.WebWindowImpl
addChildWindow, destroyChildren, getComputedStyle, getEnclosedPage, getHistory, getInnerHeight, getInnerWidth, getJobManager, getOuterHeight, getOuterWidth, getScreen, getScriptableObject, getWebClient, isClosed, performRegistration, removeChildWindow, setClosed, setInnerHeight, setInnerWidth, setJobManager, setOuterHeight, setOuterWidth, setScriptableObject
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this window. A FrameWindow shares it's name with it's containing frame.- Specified by:
getName
in interfaceWebWindow
- Overrides:
getName
in classWebWindowImpl
- Returns:
- the name of this window
-
setName
public void setName(java.lang.String name)
Sets the name of this window. A FrameWindow shares it's name with it's containing frame.- Specified by:
setName
in interfaceWebWindow
- Overrides:
setName
in classWebWindowImpl
- Parameters:
name
- the new window name
-
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.
-
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
-
getEnclosingPage
public HtmlPage getEnclosingPage()
Returns the HTML page in which the <frame> or <iframe> tag is contained for this frame window. This is a facility method for(HtmlPage) (getParentWindow().getEnclosedPage())
.- Returns:
- the page in the parent window
-
setEnclosedPage
public void setEnclosedPage(Page page)
Sets the currently loaded page.- Specified by:
setEnclosedPage
in interfaceWebWindow
- Overrides:
setEnclosedPage
in classWebWindowImpl
- Parameters:
page
- the new page or null if there is no page (ie empty window)
-
getFrameElement
public BaseFrameElement getFrameElement()
Gets the DOM node of the (i)frame containing this window.- Returns:
- the DOM node
-
toString
public java.lang.String toString()
Gives a basic representation for debugging purposes.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a basic representation
-
close
public void close()
Closes this frame window.
-
setPageDenied
public void setPageDenied(FrameWindow.PageDenied pageDenied)
Marks that the page content as denied.- Parameters:
pageDenied
- the new state
-
getPageDenied
public FrameWindow.PageDenied getPageDenied()
- Returns:
- PageDenied if the page was denied
-
-