Examples of ScriptableObject


Examples of org.mozilla.javascript.ScriptableObject

        out = System.out;
      else if (sel.equals("System.err"))
        out = System.err;
      Object simStatus = app.find(myUi, "simStatus");
      try {
        ScriptableObject scope = cx.initStandardObjects();
        cx.evaluateString(scope, script, "<cmd>", 1, null);
        if (similarity != null) similarity.destroy();
        similarity = new CustomSimilarity(cx, scope, out);
        app.setCustomSimilarity(similarity);
        app.setString(simStatus, "text", "OK");
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

   * @throws WinkBuildException
   */
  private static void executeJs(final String filename) throws WinkBuildException {
    final Context cx = Context.enter();
    cx.setOptimizationLevel(-1);
    final ScriptableObject scope = cx.initStandardObjects();

    final String fileToInspect = new String(filename);
    boolean goodExecution = false;
    try {
      final Reader buildFile = new FileReader(new File(fileToInspect));
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

      Constants.fileInMemory = Boolean.valueOf(getProperty(Constants.OPTION_FILE_IN_MEMORY));
    }

    final Context cx = Context.enter();
    cx.setOptimizationLevel(-1);
    final ScriptableObject scope = cx.initStandardObjects();

    putFunctions(cx, scope);
    putConf(cx, scope);

    final String mainFile = getProperty(Constants.JS_PATH) + File.separator + getProperty(Constants.JS_MAIN_FILE);
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

        childList.add(childList.size(), text);
    }

    protected void postRenderView() throws Exception {
        ScriptableObject scriptableObject =
                (ScriptableObject) this.page.executeJavaScript("window.LOG").getJavaScriptResult();

        scriptableObject.defineProperty("out", systemOut, ScriptableObject.READONLY);
    }
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

        loadFeatureScript(context, scope, GoogleCode.class);
    }

    public static void GoogleCode_upload(final Context context, final Scriptable thisObj,
                                         final Object[] args, final Function funcObj) throws Exception {
        final ScriptableObject config = (ScriptableObject) args[0];
        final GoogleCodeUploader uploader = new GoogleCodeUploader();
        uploader.setUserName(Context.toString(config.get("userName")));
        uploader.setPassword(Context.toString(config.get("password")));
        uploader.setProjectName(Context.toString(config.get("projectName")));
        uploader.setFileName(Context.toString(config.get("fileName")));
        uploader.setTargetFileName(Context.toString(config.get("targetFileName")));
        uploader.setSummary(Context.toString(config.get("summary")));
        if (ScriptableObject.hasProperty(config, "uploadUrl") && config.get("uploadUrl") != Context.getUndefinedValue()) {
//            uploader.setUploadUrl(Context.toString(config.get("uploadUrl")));
        }
        uploader.setVerbose(Context.toBoolean(config.get("verbose")));
        uploader.setLabels(Context.toString(config.get("labels")));
        uploader.setIgnoreSslCertificateHostname(Context.toBoolean(config.get("ignoreSslCertificateHostname")));
        uploader.execute();
    }
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

    public static Object Module_load(final Context context, final Scriptable thisObj,
                                     final Object[] args, final Function funcObj) throws Exception {
        final String name = toStringArray(args)[0];
        final String baseDir = getString(thisObj, "baseDir");
        final Module module = new Module(name, new File(baseDir, name));
        final ScriptableObject moduleObj = (ScriptableObject) context.newObject(thisObj);
        module.init(context, moduleObj);
        return moduleObj;
    }
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

*/
public final class Main {
    public static void main(String[] args) throws Exception {
        final Context context = Context.enter();
        try {
            final ScriptableObject global = context.initStandardObjects();
            final Module module = new Module("global", new File(System.getProperty("user.dir")));
            module.init(context, global);
        } finally {
            Context.exit();
        }
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

                interpreter.callHandler(function,
                    new RhinoInterpreter.ArgumentsBuilder() {
                        public Object[] buildArguments() {
                            try {
                                Object[] arguments = new Object[1];
                                ScriptableObject so =
                                    (ScriptableObject)interpreter.evaluate
                                    (new StringReader("new Object()"));
                                so.put("success", so,
                                       (success) ?
                                       Boolean.TRUE : Boolean.FALSE);
                                if (mime != null) {
                                    so.put("contentType", so,
                                           Context.toObject(mime,
                                                            windowWrapper));
                                }
                                if (content != null) {
                                    so.put("content", so,
                                           Context.toObject(content,
                                                            windowWrapper));
                                }
                                arguments[0] = so;
                                return arguments;
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

            try {
                interpreter.callMethod(object, COMPLETE,
                                       new RhinoInterpreter.ArgumentsBuilder() {
                                           public Object[] buildArguments() {
                                               Object[] arguments = new Object[1];
                                               ScriptableObject so =
                                                   new NativeObject();
                                               so.put("success", so,
                                                      (success) ?
                                                      Boolean.TRUE : Boolean.FALSE);
                                               if (mime != null) {
                                                   so.put("contentType", so,
                                                          Context.toObject(mime,
                                                                           windowWrapper));
                                               }
                                               if (content != null) {
                                                   so.put("content", so,
                                                          Context.toObject(content,
                                                                           windowWrapper));
                                               }
                                               arguments[0] = so;
                                               return arguments;
View Full Code Here

Examples of org.mozilla.javascript.ScriptableObject

                interpreter.callHandler(function,
                    new RhinoInterpreter.ArgumentsBuilder() {
                        public Object[] buildArguments() {
                            try {
                                Object[] arguments = new Object[1];
                                ScriptableObject so =
                                    (ScriptableObject)interpreter.evaluate
                                    (new StringReader("new Object()"));
                                so.put("success", so,
                                       (success) ?
                                       Boolean.TRUE : Boolean.FALSE);
                                if (mime != null) {
                                    so.put("contentType", so,
                                           Context.toObject(mime,
                                                            windowWrapper));
                                }
                                if (content != null) {
                                    so.put("content", so,
                                           Context.toObject(content,
                                                            windowWrapper));
                                }
                                arguments[0] = so;
                                return arguments;
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.