/** * Called when the event being fired ends. */ @SuppressWarnings("unchecked") public void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * @deprecated NativeJavaPackage is an internal class, do not use * it directly. */ public NativeJavaPackage(String packageName) { this(false, packageName, Context.getCurrentContext().getApplicationClassLoader()); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { return (Scriptable) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { return (Scriptable) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); }
/** * Called when the event being fired ends. */ @SuppressWarnings("unchecked") public void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
private static RegExpImpl getImpl() { Context cx = Context.getCurrentContext(); return (RegExpImpl) ScriptRuntime.getRegExpProxy(cx); }
/** * Executes the specified script code in the scope of this window. * This is used only when eval() is called on a Window other than the starting scope * @param scriptCode some JavaScript code * @return the evaluation result */ public Object custom_eval(final String scriptCode) { final Context context = Context.getCurrentContext(); final Script script = context.compileString(scriptCode, "eval body", 0, null); return script.exec(context, this); }
/** * @see #isJavaPrimitiveWrap() */ public final void setJavaPrimitiveWrap(boolean value) { Context cx = Context.getCurrentContext(); if (cx != null && cx.isSealed()) { Context.onSealedMutation(); } javaPrimitiveWrap = value; }
/** * Executes the specified script code in the scope of this window. * This is used only when eval() is called on a Window other than the starting scope * @param scriptCode some JavaScript code * @return the evaluation result */ public Object custom_eval(final String scriptCode) { final Context context = Context.getCurrentContext(); final Script script = context.compileString(scriptCode, "eval body", 0, null); return script.exec(context, this); }
/** * Returns the resolved options. * @return the options */ @JsxFunction public Object resolvedOptions() { return Context.getCurrentContext().evaluateString(getParentScope(), "var x = {locale: 'en-US'}; x", "", -1, null); }
Netscape(final Window window) { setParentScope(window); // simply put "new Object()" for property "security" put("security", this, Context.getCurrentContext().newObject(window)); }
/** * @return A new object with properties reflecting the locale and date and time formatting options * computed during the initialization of the given {@code DateTimeFormat} object. */ @JsxFunction public Scriptable resolvedOptions() { final Scriptable object = Context.getCurrentContext().newObject(getParentScope()); return object; }
/** * Cancels the current HTTP request. */ @JsxFunction public void abort() { getWindow().getWebWindow().getJobManager().stopJob(jobID_); setState(STATE_UNSENT, Context.getCurrentContext()); }
/** * Cancels the current HTTP request. */ @JsxFunction public void abort() { getWindow().getWebWindow().getJobManager().stopJob(jobID_); setState(STATE_UNSENT, Context.getCurrentContext()); }