Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.meterware.httpunit.javascript
Class JavaScript.Window  view JavaScript.Window download JavaScript.Window.java

java.lang.Object
  extended byScriptableObject
      extended bycom.meterware.httpunit.javascript.JavaScript.JavaScriptEngine
          extended bycom.meterware.httpunit.javascript.JavaScript.Window
All Implemented Interfaces:
com.meterware.httpunit.scripting.ScriptingEngine
Enclosing class:
JavaScript

public static class JavaScript.Window
extends JavaScript.JavaScriptEngine


Field Summary
private  JavaScript.Document _document
           
private  JavaScript.ElementArray _frames
           
private  JavaScript.Location _location
           
private  JavaScript.Navigator _navigator
           
protected  JavaScript.JavaScriptEngine _parent
           
private  JavaScript.Screen _screen
           
protected  com.meterware.httpunit.scripting.ScriptableDelegate _scriptable
           
 
Constructor Summary
JavaScript.Window()
           
 
Method Summary
 void clearCaches()
          Clears any cached values, permitting them to be recomputed as needed.
protected  void discardDocumentWriteBuffer()
           
 java.lang.String evaluateScriptExpression(java.lang.String urlString)
          Evaluates the specified string as JavaScript.
 java.lang.String executeScript(java.lang.String language, java.lang.String script)
          Interprets the specified script, which may include global function definitions.
 java.lang.Object get(int i, Scriptable scriptable)
           
 java.lang.Object get(java.lang.String propertyName, Scriptable scriptable)
           
 java.lang.String getClassName()
           
private  com.meterware.httpunit.WebResponse.Scriptable getDelegate()
           
protected  java.lang.StringBuffer getDocumentWriteBuffer()
           
(package private)  java.lang.String getID()
           
(package private)  java.lang.String getName()
           
 boolean has(java.lang.String propertyName, Scriptable scriptable)
           
(package private)  void initialize(JavaScript.JavaScriptEngine parent, com.meterware.httpunit.scripting.ScriptableDelegate scriptable)
           
 void jsFunction_alert(java.lang.String message)
           
 void jsFunction_close()
           
 boolean jsFunction_confirm(java.lang.String message)
           
 void jsFunction_focus()
           
 void jsFunction_moveTo(int x, int y)
           
 JavaScript.Window jsFunction_open(java.lang.Object url, java.lang.String name, java.lang.String features, boolean replace)
           
 java.lang.String jsFunction_prompt(java.lang.String message, java.lang.String defaultResponse)
           
 void jsFunction_setTimeout()
           
 JavaScript.Document jsGet_document()
           
 Scriptable jsGet_frames()
           
 JavaScript.Location jsGet_location()
           
 JavaScript.Navigator jsGet_navigator()
           
 JavaScript.Screen jsGet_screen()
           
 JavaScript.Window jsGet_self()
           
 JavaScript.Window jsGet_window()
           
 void jsSet_location(java.lang.String relativeURL)
           
 com.meterware.httpunit.scripting.ScriptingEngine newScriptingEngine(com.meterware.httpunit.scripting.ScriptableDelegate child)
          Returns a new scripting engine for the specified delegate.
 boolean performEvent(java.lang.String eventScript)
          Interprets the specified script and returns a boolean result.
 void put(java.lang.String propertyName, Scriptable scriptable, java.lang.Object value)
           
(package private)  void setLocation(java.lang.String relativeURL)
           
 boolean supportsScriptLanguage(java.lang.String language)
          Returns true if this engine supports the specified script.
protected  JavaScript.ElementArray toElementArray(com.meterware.httpunit.scripting.ScriptableDelegate[] scriptables)
           
(package private)  java.lang.Object toScriptable(com.meterware.httpunit.scripting.ScriptableDelegate delegate)
          Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable.
 java.lang.String toString()
          Convert this Object to a human-readable String.
protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_document

private JavaScript.Document _document

_navigator

private JavaScript.Navigator _navigator

_location

private JavaScript.Location _location

_screen

private JavaScript.Screen _screen

_frames

private JavaScript.ElementArray _frames

_scriptable

protected com.meterware.httpunit.scripting.ScriptableDelegate _scriptable

_parent

protected JavaScript.JavaScriptEngine _parent
Constructor Detail

JavaScript.Window

public JavaScript.Window()
Method Detail

getClassName

public java.lang.String getClassName()

jsGet_window

public JavaScript.Window jsGet_window()

jsGet_self

public JavaScript.Window jsGet_self()

jsGet_document

public JavaScript.Document jsGet_document()

jsGet_frames

public Scriptable jsGet_frames()
                        throws org.xml.sax.SAXException,
                               PropertyException,
                               JavaScriptException,
                               NotAFunctionException

jsGet_navigator

public JavaScript.Navigator jsGet_navigator()

jsGet_screen

public JavaScript.Screen jsGet_screen()

jsGet_location

public JavaScript.Location jsGet_location()

jsSet_location

public void jsSet_location(java.lang.String relativeURL)
                    throws java.io.IOException,
                           org.xml.sax.SAXException

setLocation

void setLocation(java.lang.String relativeURL)
           throws java.io.IOException,
                  org.xml.sax.SAXException

initialize

void initialize(JavaScript.JavaScriptEngine parent,
                com.meterware.httpunit.scripting.ScriptableDelegate scriptable)
          throws JavaScriptException,
                 NotAFunctionException,
                 PropertyException,
                 org.xml.sax.SAXException
Overrides:
initialize in class JavaScript.JavaScriptEngine

jsFunction_alert

public void jsFunction_alert(java.lang.String message)

jsFunction_confirm

public boolean jsFunction_confirm(java.lang.String message)

jsFunction_prompt

public java.lang.String jsFunction_prompt(java.lang.String message,
                                          java.lang.String defaultResponse)

jsFunction_moveTo

public void jsFunction_moveTo(int x,
                              int y)

jsFunction_focus

public void jsFunction_focus()

jsFunction_setTimeout

public void jsFunction_setTimeout()

jsFunction_close

public void jsFunction_close()

jsFunction_open

public JavaScript.Window jsFunction_open(java.lang.Object url,
                                         java.lang.String name,
                                         java.lang.String features,
                                         boolean replace)
                                  throws PropertyException,
                                         JavaScriptException,
                                         NotAFunctionException,
                                         java.io.IOException,
                                         org.xml.sax.SAXException

clearCaches

public void clearCaches()
Description copied from interface: com.meterware.httpunit.scripting.ScriptingEngine
Clears any cached values, permitting them to be recomputed as needed.

Specified by:
clearCaches in interface com.meterware.httpunit.scripting.ScriptingEngine
Overrides:
clearCaches in class JavaScript.JavaScriptEngine

getDocumentWriteBuffer

protected java.lang.StringBuffer getDocumentWriteBuffer()
Overrides:
getDocumentWriteBuffer in class JavaScript.JavaScriptEngine

discardDocumentWriteBuffer

protected void discardDocumentWriteBuffer()
Overrides:
discardDocumentWriteBuffer in class JavaScript.JavaScriptEngine

getDelegate

private com.meterware.httpunit.WebResponse.Scriptable getDelegate()

supportsScriptLanguage

public boolean supportsScriptLanguage(java.lang.String language)
Description copied from interface: com.meterware.httpunit.scripting.ScriptingEngine
Returns true if this engine supports the specified script.

Specified by:
supportsScriptLanguage in interface com.meterware.httpunit.scripting.ScriptingEngine

executeScript

public java.lang.String executeScript(java.lang.String language,
                                      java.lang.String script)
Description copied from interface: com.meterware.httpunit.scripting.ScriptingEngine
Interprets the specified script, which may include global function definitions.

Specified by:
executeScript in interface com.meterware.httpunit.scripting.ScriptingEngine

performEvent

public boolean performEvent(java.lang.String eventScript)
Description copied from interface: com.meterware.httpunit.scripting.ScriptingEngine
Interprets the specified script and returns a boolean result.

Specified by:
performEvent in interface com.meterware.httpunit.scripting.ScriptingEngine

evaluateScriptExpression

public java.lang.String evaluateScriptExpression(java.lang.String urlString)
Evaluates the specified string as JavaScript. Will return null if the script has no return value.

Specified by:
evaluateScriptExpression in interface com.meterware.httpunit.scripting.ScriptingEngine

getName

java.lang.String getName()

getID

java.lang.String getID()

has

public boolean has(java.lang.String propertyName,
                   Scriptable scriptable)

get

public java.lang.Object get(java.lang.String propertyName,
                            Scriptable scriptable)

get

public java.lang.Object get(int i,
                            Scriptable scriptable)

put

public void put(java.lang.String propertyName,
                Scriptable scriptable,
                java.lang.Object value)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


newScriptingEngine

public com.meterware.httpunit.scripting.ScriptingEngine newScriptingEngine(com.meterware.httpunit.scripting.ScriptableDelegate child)
Description copied from interface: com.meterware.httpunit.scripting.ScriptingEngine
Returns a new scripting engine for the specified delegate.

Specified by:
newScriptingEngine in interface com.meterware.httpunit.scripting.ScriptingEngine

toStringIfNotUndefined

protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)

toScriptable

final java.lang.Object toScriptable(com.meterware.httpunit.scripting.ScriptableDelegate delegate)
Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable.


toElementArray

protected JavaScript.ElementArray toElementArray(com.meterware.httpunit.scripting.ScriptableDelegate[] scriptables)