Examples of JSObject


Examples of com.dragome.commons.javascript.JSObject

      return annotations;

    int i= 0;
    for (Object map : maps)
    {
      InvocationHandler handler= new AnnotationInvocationHandler(new JSObject(map));
      Annotation annotation= (Annotation) Proxy.newProxyInstance(null, new Class[] { null }, handler);
      annotations[i++]= annotation;
    }
    return annotations;
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.js.JsObject

   * @param model the model
   * @param maxDepth the maximum number of sub models to process
   * @return the javascript object
   */
  public static JavaScriptObject getJsObject(ModelData model, int maxDepth) {
    JsObject jsObj = new JsObject();
    for (String key : model.getPropertyNames()) {
      Object value = model.get(key);
      if (maxDepth > 0) {
        internalProcessObject(jsObj, maxDepth, value, key);
      } else {
        jsObj.set(key, value);
      }
    }
    return jsObj.getJsObject();
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.js.JsObject

  private static JsArray processMap(Map<?, ?> map, int maxDepth) {
    JsArray jsArray = new JsArray();
    if (maxDepth > 0) {
      for (Entry<?, ?> o : map.entrySet()) {
        JsObject jsObj = new JsObject();
        internalProcessObject(jsObj, maxDepth, o.getKey(), "key");
        internalProcessObject(jsObj, maxDepth, o.getValue(), "value");
        jsArray.add(jsObj.getJsObject());
      }
    }
    return jsArray;
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.js.JsObject

    if (values != null) {
      return JsUtil.toJavaScriptArray(values.toArray());
    } else if (mapValues != null) {
      return JsUtil.toJavaScriptObject(mapValues);
    }
    return new JsObject().getJsObject();
  }
View Full Code Here

Examples of com.google.minijoe.sys.JsObject

   *
   * @param f the function to be called
   * @param key the key event
   */
  public void keyEvent(JsFunction f, int code, int action) {
    JsObject event = new JsObject(JsObject.OBJECT_PROTOTYPE);

    switch(action){
      case Canvas.LEFT:
        code = 37;
        break;
      case Canvas.UP:
        code = 38;
        break;
      case Canvas.RIGHT:
        code = 39;
        break;
      case Canvas.DOWN:
        code = 40;
        break;
    }
  
    event.addVar("keyCode", new Double(code));
    synchronized (eventLock) {
      stack.setObject(1, this);
      stack.setObject(2, f);
      stack.setObject(3, event);
      f.eval(stack, 1, 1);
View Full Code Here

Examples of com.sencha.gxt.legacy.client.core.js.JsObject

    if (values != null) {
      return JsUtil.toJavaScriptArray(values.toArray());
    } else if (mapValues != null) {
      return JsUtil.toJavaScriptObject(mapValues);
    }
    return new JsObject().getJsObject();
  }
View Full Code Here

Examples of lupos.event.producer.ebay.parser.JSObject

    int counter = 0;
   
    try {
      for (int page = 1, max = (int) Math.ceil((double) this.config.resultCount / Configuration.ENTRIES_PER_PAGE); this.loop && page <= max; page++) {
        final String content = this.getContent(page);
        final JSObject model = JSONParser.parse(content);
       
        try {
          JSObject searchResult =
              model.get(this.config.opName + "Response").get("searchResult");
          final int count = (page == max)
              ? ((this.config.resultCount - 1) % Configuration.ENTRIES_PER_PAGE) + 1
              : Integer.parseInt(searchResult.get("@count").toString());
   
          for (int i = 0; this.loop && i < count; i++) {
            counter++;
            JSObject item = searchResult.get("item").get(i);   
            auctions.add(new Auction(item));         
          }
        }
        catch (NullPointerException e) {
          // ignore...
View Full Code Here

Examples of mug.runtime.JSObject

      @Override
      public Object invoke(Object ths, int argc, Object l0, Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object[] rest) throws Exception
      {
        // coerce path
        String qn = JSUtils.asString(l0);
        final JSObject obj = (JSObject) l1;
        Class javaClass = Class.forName(qn);
       
        return new ReflectedJSJavaObject(env, Proxy.newProxyInstance(javaClass.getClassLoader(),
          new Class[] { javaClass },
          new InvocationHandler() {
            public Object invoke(Object ths, Method method, Object[] args) throws Throwable {
              JSObject meth = (JSObject) obj.get(method.getName());
              return JSJavaUtils.coerceJavaType(meth.invoke(ths, args), method.getReturnType());
            }
          }));
      }
    };
   
    // exports library
    final JSObject exports = new JSObject(env) { {
      defineProperty("import", _import);
      defineProperty("Proxy", _Proxy);
     
      // default top-level java packages
      String[] pkgs = new String[] { "io", "nio", "lang", "util" };
View Full Code Here

Examples of netscape.javascript.JSObject

            fun.call();
        }
    }

    private void prepareEngine() {
        JSObject window = (JSObject) engine.executeScript("window");
        window.setMember("exportProfile", this);

        // uncomment this for debugging
//        engine.executeScript("if (!document.getElementById('FirebugLite')){E = document['createElement' + 'NS'] && document.documentElement.namespaceURI;E = E ? document['createElement' + 'NS'](E, 'script') : document['createElement']('script');E['setAttribute']('id', 'FirebugLite');E['setAttribute']('src', 'https://getfirebug.com/' + 'firebug-lite.js' + '#startOpened');E['setAttribute']('FirebugLite', '4');(document['getElementsByTagName']('head')[0] || document['getElementsByTagName']('body')[0]).appendChild(E);E = new Image;E['setAttribute']('src', 'https://getfirebug.com/' + '#startOpened');}");
    }
View Full Code Here

Examples of netscape.javascript.JSObject

        if (applicationHostApplet == null) {
            throw new IllegalArgumentException("No applet is hosting the given application.");
        }

        try {
            JSObject window = JSObject.getWindow(applicationHostApplet);
            return window.eval(script);
        } catch (Throwable throwable) {
            throw new UnsupportedOperationException(throwable);
        }
    }
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.