public abstract class WebWindowImpl extends Object implements WebWindow
WebWindow
Constructor and Description |
---|
WebWindowImpl(WebClient webClient)
Creates a window and associates it with the client.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildWindow(WebWindowImpl child)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
protected void |
destroyChildren()
Destroy our children.
|
ComputedCssStyleDeclaration |
getComputedStyle(DomElement element,
String pseudoElement)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
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.
|
JavaScriptJobManager |
getJobManager()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
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.
|
Screen |
getScreen() |
<T> T |
getScriptableObject()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
WebClient |
getWebClient()
Returns the web client that "owns" this window.
|
boolean |
isClosed()
Indicates if this window is closed.
|
protected abstract boolean |
isJavaScriptInitializationNeeded(Page page)
Returns
true if this window needs JavaScript initialization to occur when the enclosed page is set. |
protected void |
performRegistration()
Registers the window with the client.
|
void |
removeChildWindow(WebWindowImpl window)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
protected void |
setClosed()
Sets this window as 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 |
setJobManager(JavaScriptJobManager jobManager)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
setName(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 HtmlUnitScriptable> |
setScriptableObject(T scriptObject)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentWindow, getTopWindow
public WebWindowImpl(WebClient webClient)
webClient
- the web client that "owns" this windowprotected void performRegistration()
public WebClient getWebClient()
getWebClient
in interface WebWindow
public Screen getScreen()
public Page getEnclosedPage()
getEnclosedPage
in interface WebWindow
public void setEnclosedPage(Page page)
setEnclosedPage
in interface WebWindow
page
- the new page or null if there is no page (ie empty window)protected abstract boolean isJavaScriptInitializationNeeded(Page page)
true
if this window needs JavaScript initialization to occur when the enclosed page is set.page
- the page that will become the enclosing pagetrue
if this window needs JavaScript initialization to occur when the enclosed page is setpublic <T extends HtmlUnitScriptable> void setScriptableObject(T scriptObject)
setScriptableObject
in interface WebWindow
T
- the object typescriptObject
- the JavaScript objectpublic <T> T getScriptableObject()
getScriptableObject
in interface WebWindow
T
- the object typepublic JavaScriptJobManager getJobManager()
getJobManager
in interface WebWindow
public void setJobManager(JavaScriptJobManager jobManager)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Sets the JavaScript job manager for this window.
jobManager
- the JavaScript job manager to usepublic void addChildWindow(WebWindowImpl child)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Adds a child to this window, for shutdown purposes.
child
- the child window to associate with this windowprotected void destroyChildren()
public void removeChildWindow(WebWindowImpl window)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Destroy the child window.window
- the child to destroypublic String getName()
public void setName(String name)
public History getHistory()
getHistory
in interface WebWindow
public boolean isClosed()
protected void setClosed()
public int getInnerWidth()
getInnerWidth
in interface WebWindow
public void setInnerWidth(int innerWidth)
setInnerWidth
in interface WebWindow
innerWidth
- the inner widthpublic int getOuterWidth()
getOuterWidth
in interface WebWindow
public void setOuterWidth(int outerWidth)
setOuterWidth
in interface WebWindow
outerWidth
- the outer widthpublic int getInnerHeight()
getInnerHeight
in interface WebWindow
public void setInnerHeight(int innerHeight)
setInnerHeight
in interface WebWindow
innerHeight
- the inner heightpublic int getOuterHeight()
getOuterHeight
in interface WebWindow
public void setOuterHeight(int outerHeight)
setOuterHeight
in interface WebWindow
outerHeight
- the outer heightpublic ComputedCssStyleDeclaration getComputedStyle(DomElement element, String pseudoElement)
element.style
, but the value returned by this method is read-only.getComputedStyle
in interface WebWindow
element
- the elementpseudoElement
- a string specifying the pseudo-element to match (may be null
);
e.g. ':before'Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.