Examples of ImporterTopLevel


Examples of org.mozilla.javascript.ImporterTopLevel

  }
 
  private Scriptable createGlobalScope() {
    try {
      final Context cx = Context.enter();
      final ScriptableObject importer = new ImporterTopLevel(cx, true);
      return cx.initStandardObjects(importer, true);
    } finally {
      Context.exit();
    }
  }
View Full Code Here

Examples of org.mozilla.javascript.ImporterTopLevel

    public RhinoInterpreter() {
        // entering a context
        context = Context.enter();
        try {
            // init std object with an importer
            ImporterTopLevel importer = new ImporterTopLevel(context);
            globalObject = (ScriptableObject)context.initStandardObjects(importer);
            // import Java lang package & DOM Level 2 & SVG DOM packages
            NativeJavaPackage[] p= new NativeJavaPackage[TO_BE_IMPORTED.length];
            for (int i = 0; i < TO_BE_IMPORTED.length; i++) {
                p[i] = new NativeJavaPackage(TO_BE_IMPORTED[i]);
            }
            importer.importPackage(context, globalObject, p, null);
            context.setWrapHandler(new EventTargetWrapHandler(this));
        } finally {
            Context.exit();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.