/** * @deprecated * @see ContextFactory#removeListener(ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#removeListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ @Deprecated public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#removeListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#removeListener(ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#removeListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#removeListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void removeContextListener(ContextListener listener) { ContextFactory.getGlobal().addListener(listener); }
/** * Attaches the debugger to the given ContextFactory. */ public void attachTo(ContextFactory factory) { detach(); this.contextFactory = factory; this.listener = new DimIProxy(this, IPROXY_LISTEN); factory.addListener(this.listener); }
/** * Attaches the debugger to the given ContextFactory. */ public void attachTo(ContextFactory factory) { detach(); this.contextFactory = factory; this.listener = new DimIProxy(this, IPROXY_LISTEN); factory.addListener(this.listener); }
/** * * @param classloader * @param factory */ public JSR223RhinoScriptEngine(ClassLoader classloader, BiFunction<Context, javax.script.ScriptEngine, ScriptableObject> factory) { super(); if (factory == null) { throw new java.lang.IllegalArgumentException("factory is null!"); } if (classloader != null) { contextFactory.initApplicationClassLoader(classloader); } contextFactory.addListener(cxListener); this.topLevel = (ScriptableObject) contextFactory.call((Context cx) -> { return factory.apply(cx, this); }); }
/** * @deprecated * @see ContextFactory#addListener(ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class<?> cl = listener.getClass(); Class<?> factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class<?>[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#addListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ @Deprecated public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class<?> cl = listener.getClass(); Class<?> factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class<?>[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#addListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class<?> cl = listener.getClass(); Class<?> factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class<?>[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#addListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class<?> cl = listener.getClass(); Class<?> factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class<?>[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#addListener(org.mozilla.javascript.ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class<?> cl = listener.getClass(); Class<?> factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class<?>[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
/** * @deprecated * @see ContextFactory#addListener(ContextFactory.Listener) * @see ContextFactory#getGlobal() */ public static void addContextListener(ContextListener listener) { // Special workaround for the debugger String DBG = "org.mozilla.javascript.tools.debugger.Main"; if (DBG.equals(listener.getClass().getName())) { Class cl = listener.getClass(); Class factoryClass = Kit.classOrNull( "org.mozilla.javascript.ContextFactory"); Class[] sig = { factoryClass }; Object[] args = { ContextFactory.getGlobal() }; try { Method m = cl.getMethod("attachTo", sig); m.invoke(listener, args); } catch (Exception ex) { RuntimeException rex = new RuntimeException(); Kit.initCause(rex, ex); throw rex; } return; } ContextFactory.getGlobal().addListener(listener); }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { @Override protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
static synchronized Main getDebugger() { if (debugger == null) { final Main db = new Main("Cocoon Flow Debugger"); db.pack(); Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); size.width *= 0.75; size.height *= 0.75; db.setSize(size.width, size.height); db.setExitAction(new Runnable() { public void run() { db.setVisible(false); } }); db.setOptimizationLevel(OPTIMIZATION_LEVEL); db.setVisible(true); debugger = db; ContextFactory.getGlobal().addListener(debugger); } return debugger; }