/** * Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable. **/ final Object toScriptable( ScriptableDelegate delegate ) { if (delegate == null) { return NOT_FOUND; } else if (delegate.getScriptEngine() instanceof Scriptable) { return (Scriptable) delegate.getScriptEngine(); } else { try { JavaScriptEngine element = (JavaScriptEngine) Context.getCurrentContext().newObject( this, getScriptableClassName( delegate ) ); element.initialize( this, delegate ); return element; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RhinoException( e ); } } }
/** * Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable. **/ final Object toScriptable( ScriptableDelegate delegate ) { if (delegate == null) { return NOT_FOUND; } else if (delegate.getScriptEngine() instanceof Scriptable) { return (Scriptable) delegate.getScriptEngine(); } else { try { JavaScriptEngine element = (JavaScriptEngine) Context.getCurrentContext().newObject( this, getScriptableClassName( delegate ) ); element.initialize( this, delegate ); return element; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RhinoException( e ); } } }
/** * Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable. **/ final Object toScriptable( ScriptableDelegate delegate ) { if (delegate == null) { return NOT_FOUND; } else if (delegate.getScriptEngine() instanceof Scriptable) { return (Scriptable) delegate.getScriptEngine(); } else { try { JavaScriptEngine element = (JavaScriptEngine) Context.getCurrentContext().newObject( this, getScriptableClassName( delegate ) ); element.initialize( this, delegate ); return element; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RhinoException( e ); } } }
/** * initialize JavaScript for the given ScriptEngine * @parent - the Script Engine to use * @scriptable - the scriptable object to do the initialization for */ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _location = (Location) Context.getCurrentContext().newObject( this, "Location" ); _location.initialize(this, ((WebResponse.Scriptable) scriptable).getURL() ); _navigator = (Navigator) Context.getCurrentContext().newObject( this, "Navigator" ); _navigator.setClientProperties( getDelegate().getClientProperties() ); _screen = (Screen) Context.getCurrentContext().newObject( this, "Screen" ); _screen.setClientProperties( getDelegate().getClientProperties() ); }
/** * initialize JavaScript for the given ScriptEngine * @parent - the Script Engine to use * @scriptable - the scriptable object to do the initialization for */ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _location = (Location) Context.getCurrentContext().newObject( this, "Location" ); _location.initialize(this, ((WebResponse.Scriptable) scriptable).getURL() ); _navigator = (Navigator) Context.getCurrentContext().newObject( this, "Navigator" ); _navigator.setClientProperties( getDelegate().getClientProperties() ); _screen = (Screen) Context.getCurrentContext().newObject( this, "Screen" ); _screen.setClientProperties( getDelegate().getClientProperties() ); }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); if (parent instanceof Form) _form = (Form) parent; }
/** * initialize JavaScript for the given ScriptEngine * @parent - the Script Engine to use * @scriptable - the scriptable object to do the initialization for */ void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _location = (Location) Context.getCurrentContext().newObject( this, "Location" ); _location.initialize(this, ((WebResponse.Scriptable) scriptable).getURL() ); _navigator = (Navigator) Context.getCurrentContext().newObject( this, "Navigator" ); _navigator.setClientProperties( getDelegate().getClientProperties() ); _screen = (Screen) Context.getCurrentContext().newObject( this, "Screen" ); _screen.setClientProperties( getDelegate().getClientProperties() ); }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _document = (Document) parent; _style = (Style) Context.getCurrentContext().newObject( this, "Style" ); }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); if (parent instanceof Form) _form = (Form) parent; }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _document = (Document) parent; _style = (Style) Context.getCurrentContext().newObject( this, "Style" ); }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); if (parent instanceof Form) _form = (Form) parent; }
void initialize( JavaScriptEngine parent, ScriptableDelegate scriptable ) throws JavaScriptException, NotAFunctionException, PropertyException, SAXException { super.initialize( parent, scriptable ); _document = (Document) parent; _style = (Style) Context.getCurrentContext().newObject( this, "Style" ); }