Class WindowWrapper

java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.TopLevel
org.mozilla.javascript.ImporterTopLevel
org.apache.batik.bridge.WindowWrapper
All Implemented Interfaces:
Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.IdFunctionCall, org.mozilla.javascript.Scriptable, org.mozilla.javascript.SymbolScriptable
Direct Known Subclasses:
GlobalWrapper

public class WindowWrapper extends org.mozilla.javascript.ImporterTopLevel
This class wraps a Window object to expose it to the interpreter. This will be the Global Object of our interpreter.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    To wrap a function in an handler.
    protected static class 
    To wrap a function passed to getURL().

    Nested classes/interfaces inherited from class org.mozilla.javascript.TopLevel

    org.mozilla.javascript.TopLevel.Builtins

    Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject

    org.mozilla.javascript.ScriptableObject.KeyComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The rhino interpreter.
    protected Window
    The wrapped window.

    Fields inherited from class org.mozilla.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.mozilla.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    WindowWrapper(org.mozilla.javascript.Context context)
    Creates a new WindowWrapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    alert(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'alert' method of the Window interface.
    static void
    clearInterval(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'clearInterval' method of the Window interface.
    static void
    clearTimeout(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'clearTimeout' method of the Window interface.
    static Object
    confirm(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'confirm' method of the Window interface.
     
    Return the Location for this Window.
    static void
    getURL(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'getURL' method of the Window interface.
    static Object
    parseXML(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'parseXML' method of the Window interface.
    static void
    postURL(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'postURL' method of the Window interface.
    static Object
    printNode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'printNode' method of the Window interface.
    static Object
    prompt(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'prompt' method of the Window interface.
    static Object
    setInterval(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'setInterval' methods of the Window interface.
    void
    Return the Location for this Window.
    static Object
    setTimeout(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
    Wraps the 'setTimeout' methods of the Window interface.
     

    Methods inherited from class org.mozilla.javascript.ImporterTopLevel

    execIdCall, findPrototypeId, get, has, importPackage, init, initPrototypeId, initStandardObjects

    Methods inherited from class org.mozilla.javascript.TopLevel

    cacheBuiltins, getBuiltinCtor, getBuiltinCtor, getBuiltinPrototype, getBuiltinPrototype

    Methods inherited from class org.mozilla.javascript.IdScriptableObject

    activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, getAttributes, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue

    Methods inherited from class org.mozilla.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • interpreter

      protected RhinoInterpreter interpreter
      The rhino interpreter.
    • window

      protected Window window
      The wrapped window.
  • Constructor Details

    • WindowWrapper

      public WindowWrapper(org.mozilla.javascript.Context context)
      Creates a new WindowWrapper.
  • Method Details

    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface org.mozilla.javascript.Scriptable
      Overrides:
      getClassName in class org.mozilla.javascript.ImporterTopLevel
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setInterval

      public static Object setInterval(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'setInterval' methods of the Window interface.
    • setTimeout

      public static Object setTimeout(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'setTimeout' methods of the Window interface.
    • clearInterval

      public static void clearInterval(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'clearInterval' method of the Window interface.
    • clearTimeout

      public static void clearTimeout(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'clearTimeout' method of the Window interface.
    • parseXML

      public static Object parseXML(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'parseXML' method of the Window interface.
    • printNode

      public static Object printNode(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'printNode' method of the Window interface.
    • getURL

      public static void getURL(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'getURL' method of the Window interface.
    • postURL

      public static void postURL(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'postURL' method of the Window interface.
    • alert

      public static void alert(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'alert' method of the Window interface.
    • confirm

      public static Object confirm(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'confirm' method of the Window interface.
    • prompt

      public static Object prompt(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
      Wraps the 'prompt' method of the Window interface.
    • getLocation

      public Location getLocation()
      Return the Location for this Window.
    • setLocation

      public void setLocation(Object val)
      Return the Location for this Window.