com.gargoylesoftware.htmlunit
Class WebWindowImpl

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.WebWindowImpl
All Implemented Interfaces:
WebWindow, Serializable
Direct Known Subclasses:
DialogWindow, FrameWindow, TopLevelWindow

public abstract class WebWindowImpl
extends Object
implements WebWindow

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Base class for common WebWindow functionality. While public, this class is not exposed in any other places of the API. Internally we can cast to this class when we need access to functionality that is not present in WebWindow

Version:
$Revision: 5559 $
Author:
Brad Clarke, David K. Taylor, Ahmed Ashour
See Also:
Serialized Form

Constructor Summary
protected WebWindowImpl()
          Deprecated. As of 1.12
  WebWindowImpl(WebClient webClient)
          Creates a window and associates it with the client.
 
Method Summary
 void addChildWindow(FrameWindow child)
          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.
 com.gargoylesoftware.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.
 String getName()
          Returns the name of this window.
 Object getScriptObject()
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the JavaScript object that corresponds to this element.
 WebClient getWebClient()
          Returns the web client that "owns" this window.
 boolean isClosed()
          Indicates if this window is closed.
protected abstract  boolean isJavaScriptInitializationNeeded()
          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.
protected  void setClosed()
          Sets this window as closed.
 void setEnclosedPage(Page page)
          Sets the currently loaded page.
 void setJobManager(com.gargoylesoftware.htmlunit.javascript.background.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 setScriptObject(Object scriptObject)
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Sets the JavaScript object that corresponds to this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.gargoylesoftware.htmlunit.WebWindow
getParentWindow, getTopWindow
 

Constructor Detail

WebWindowImpl

@Deprecated
protected WebWindowImpl()
Deprecated. As of 1.12

Never call this, used for Serialization.


WebWindowImpl

public WebWindowImpl(WebClient webClient)
Creates a window and associates it with the client.

Parameters:
webClient - the web client that "owns" this window
Method Detail

performRegistration

protected void performRegistration()
Registers the window with the client.


getWebClient

public WebClient getWebClient()
Returns the web client that "owns" this window.

Specified by:
getWebClient in interface WebWindow
Returns:
the web client or null if this window has been closed

getEnclosedPage

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

Specified by:
getEnclosedPage in interface WebWindow
Returns:
the currently loaded page or null if no page has been loaded

setEnclosedPage

public void setEnclosedPage(Page page)
Sets the currently loaded page.

Specified by:
setEnclosedPage in interface WebWindow
Parameters:
page - the new page or null if there is no page (ie empty window)

isJavaScriptInitializationNeeded

protected abstract boolean isJavaScriptInitializationNeeded()
Returns true if this window needs JavaScript initialization to occur when the enclosed page is set.

Returns:
true if this window needs JavaScript initialization to occur when the enclosed page is set

setScriptObject

public void setScriptObject(Object 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:
setScriptObject in interface WebWindow
Parameters:
scriptObject - the JavaScript object

getScriptObject

public Object getScriptObject()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the JavaScript object that corresponds to this element.

Specified by:
getScriptObject in interface WebWindow
Returns:
the JavaScript object that corresponds to this element

getJobManager

public com.gargoylesoftware.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.

Specified by:
getJobManager in interface WebWindow
Returns:
the job manager for this window

setJobManager

public void setJobManager(com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManager jobManager)

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Sets the JavaScript job manager for this window.

Parameters:
jobManager - the JavaScript job manager to use

addChildWindow

public void addChildWindow(FrameWindow child)

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

Adds a child to this window, for shutdown purposes.

Parameters:
child - the child window to associate with this window

getName

public String getName()
Returns the name of this window.

Specified by:
getName in interface WebWindow
Returns:
the name of this window

setName

public void setName(String name)
Sets the name of this window.

Specified by:
setName in interface WebWindow
Parameters:
name - the new window name

getHistory

public History getHistory()
Returns this window's navigation history.

Specified by:
getHistory in interface WebWindow
Returns:
this window's navigation history

isClosed

public boolean isClosed()
Indicates if this window is closed. No action should be performed on a closed window.

Specified by:
isClosed in interface WebWindow
Returns:
true when the window is closed

setClosed

protected void setClosed()
Sets this window as closed.



Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.