public ScriptingEngine newScriptingEngine( ScriptableDelegate child ) { try { return (ScriptingEngine) toScriptable( child ); } catch (Exception e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } }
public ScriptingEngine newScriptingEngine( ScriptableDelegate child ) { try { return (ScriptingEngine) toScriptable( child ); } catch (Exception e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } }
public ScriptingEngine newScriptingEngine( ScriptableDelegate child ) { try { return (ScriptingEngine) toScriptable( child ); } catch (Exception e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } }
public Object jsFunction_getElementById( String id ) { ScriptableDelegate elementWithID = getDelegate().getElementWithID( id ); return elementWithID == null ? null : toScriptable( elementWithID ); }
private void initializeControls() throws PropertyException, NotAFunctionException, JavaScriptException { ScriptableDelegate scriptables[] = getDelegate().getElementDelegates(); Control[] controls = new Control[ scriptables.length ]; for (int i = 0; i < controls.length; i++) { controls[ i ] = (Control) toScriptable( scriptables[ i ] ); } _controls = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); _controls.initialize( controls ); }
private Object toScriptable( ScriptableDelegate[] list ) { Object[] delegates = new Object[ list.length ]; for (int i = 0; i < delegates.length; i++) { delegates[i] = toScriptable( list[i] ); } return Context.getCurrentContext().newArray( this, delegates ); }
private Object convertIfNeeded( final Object property ) { if (property == null) return NOT_FOUND; if (property instanceof ScriptableDelegate[]) return toScriptable( (ScriptableDelegate[]) property ); if (!(property instanceof ScriptableDelegate)) return property; return toScriptable( (ScriptableDelegate) property ); }
protected ElementArray toElementArray( ScriptingHandler[] scriptables ) { JavaScriptEngine[] elements = new JavaScriptEngine[ scriptables.length ]; for (int i = 0; i < elements.length; i++) { elements[ i ] = (JavaScriptEngine) toScriptable( (ScriptableDelegate) scriptables[ i ] ); } ElementArray result = ElementArray.newElementArray( this ); result.initialize( elements ); return result; } }
protected ElementArray toElementArray( ScriptingHandler[] scriptables ) { JavaScriptEngine[] elements = new JavaScriptEngine[ scriptables.length ]; for (int i = 0; i < elements.length; i++) { elements[ i ] = (JavaScriptEngine) toScriptable( (ScriptableDelegate) scriptables[ i ] ); } ElementArray result = ElementArray.newElementArray( this ); result.initialize( elements ); return result; } }
protected ElementArray toElementArray( ScriptingHandler[] scriptables ) { JavaScriptEngine[] elements = new JavaScriptEngine[ scriptables.length ]; for (int i = 0; i < elements.length; i++) { elements[ i ] = (JavaScriptEngine) toScriptable( (ScriptableDelegate) scriptables[ i ] ); } ElementArray result = ElementArray.newElementArray( this ); result.initialize( elements ); return result; } }
private Object toScriptable( ScriptableDelegate[] list ) { Object[] delegates = new Object[ list.length ]; for (int i = 0; i < delegates.length; i++) { delegates[i] = toScriptable( list[i] ); } return Context.getCurrentContext().newArray( this, delegates ); }
private Object convertIfNeeded( final Object property ) { if (property == null) return NOT_FOUND; if (property instanceof ScriptableDelegate[]) return toScriptable( (ScriptableDelegate[]) property ); if (!(property instanceof ScriptableDelegate)) return property; return toScriptable( (ScriptableDelegate) property ); }
public Scriptable jsGet_frames() throws SAXException, PropertyException, JavaScriptException, NotAFunctionException { if (_frames == null) { WebResponse.Scriptable scriptables[] = getDelegate().getFrames(); Window[] frames = new Window[ scriptables.length ]; for (int i = 0; i < frames.length; i++) { frames[ i ] = (Window) toScriptable( scriptables[ i ] ); } _frames = (ElementArray) Context.getCurrentContext().newObject( this, "ElementArray" ); _frames.initialize( frames ); } return _frames; }
private Object convertIfNeeded( final Object property ) { if (property == null) return NOT_FOUND; if (property instanceof ScriptableDelegate[]) return toScriptable( (ScriptableDelegate[]) property ); if (!(property instanceof ScriptableDelegate)) return property; return toScriptable( (ScriptableDelegate) property ); }
private Object toScriptable( ScriptableDelegate[] list ) { Object[] delegates = new Object[ list.length ]; for (int i = 0; i < delegates.length; i++) { delegates[i] = toScriptable( list[i] ); } return Context.getCurrentContext().newArray( this, delegates ); }
public Window jsFunction_open( Object url, String name, String features, boolean replace ) throws PropertyException, JavaScriptException, NotAFunctionException, IOException, SAXException { WebResponse.Scriptable delegate = getDelegate().open( toStringIfNotUndefined( url ), name, features, replace ); return delegate == null ? null : (Window) toScriptable( delegate ); }
public Document jsGet_document() { if (_document == null) { _document = (Document) toScriptable( getDelegate().getDocument() ); } return _document; }