Examples of Scriptable


Examples of booton.soeur.Scriptable

@SuppressWarnings("unused")
public class WideningPrimitiveConversionTest extends ScriptTester {

    @Test
    public void longToDouble() throws Exception {
        test(new Scriptable() {

            double act(long value) {
                return value / 2;
            }
        });
View Full Code Here

Examples of com.dotcms.repackage.org.mozilla.javascript.Scriptable

            global.put(bean.name, global, bean.bean);
        }
        else {
            // Must wrap non-scriptable objects before presenting to Rhino
          WrapFactory wf = new WrapFactory();
          Scriptable wrapped = wf.wrapAsJavaObject(Context.enter(), global, bean.bean, bean.type);
//            Scriptable wrapped = Context.toObject(bean.bean, global);
            global.put(bean.name, global, wrapped);
        }
    }
View Full Code Here

Examples of de.innovationgate.ext.org.mozilla.javascript.Scriptable

        if (toBeFormatted instanceof NativeJavaObject) {
            toBeFormatted = ((NativeJavaObject) toBeFormatted).unwrap();
        }
        else if (toBeFormatted instanceof Scriptable && toBeFormatted.getClass().getName().equals("de.innovationgate.ext.org.mozilla.javascript.NativeDate")) {
            Scriptable jsDate = (Scriptable) toBeFormatted;
            Double javaTime = (Double) ScriptableObject.callMethod(jsDate, "getTime", null);
            toBeFormatted = new Date(javaTime.longValue());
        }
        else if (toBeFormatted instanceof Scriptable) {
            toBeFormatted = ((Scriptable) toBeFormatted).getDefaultValue(null);
View Full Code Here

Examples of net.rim.device.api.script.Scriptable

      });
    }else if (args.length == 2){
      final ScriptableFunction _callback = (ScriptableFunction)args[0];
     
      //if they pass the optional parameter. The default location
      final Scriptable ops = (Scriptable) args[1];
     
      UiApplication.getUiApplication().invokeLater(new Runnable()
      {
        public void run()
        {
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.Scriptable

  }

  @Override
  public void freeValue(BrowserChannel channel, int[] ids) {
    for (int id : ids) {
      Scriptable scriptable = refToJsObject.remove(id);
      if (scriptable != null) {
        jsObjectToRef.remove(scriptable);
      }
    }
  }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

                    "helma.scripting.rhino.extensions.XmlRpcObject", false);
            MailObject.init(global, app.getProperties());
            JSAdapter.init(context, global, false);

            // add some convenience functions to string, date and number prototypes
            Scriptable stringProto = ScriptableObject.getClassPrototype(global, "String");
            stringProto.put("trim", stringProto, new StringTrim());

            Scriptable dateProto = ScriptableObject.getClassPrototype(global, "Date");
            dateProto.put("format", dateProto, new DateFormat());

            Scriptable numberProto = ScriptableObject.getClassPrototype(global, "Number");
            numberProto.put("format", numberProto, new NumberFormat());

            Collection protos = app.getPrototypes();
            for (Iterator i = protos.iterator(); i.hasNext();) {
                Prototype proto = (Prototype) i.next();
                initPrototype(proto);
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

    * Check if an object has a function property (public method if it
    * is a java object) with that name.
    */
    public boolean hasFunction(String protoname, String fname) {
        // throws EvaluatorException if type has a syntax error
        Scriptable op = getValidPrototype(protoname);

        // if this is an untyped object return false
        if (op == null) {
            return false;
        }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

                    ht.put(key, processXmlRpcResponse(prop.getValue()));
                }
            }
            return ht;
        } else if (arg instanceof Scriptable) {
            Scriptable s = (Scriptable) arg;
            if ("Date".equals(s.getClassName())) {
                return new Date((long) ScriptRuntime.toNumber(s));
            }
        }
        return arg;
    }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

        Wrapper wrapper = ref == null ? null : (Wrapper) ref.get();

        if (wrapper == null || wrapper.unwrap() != e) {
            // Gotta find out the prototype name to use for this object...
            String prototypeName = app.getPrototypeName(e);
            Scriptable op = getPrototype(prototypeName);

            if (op == null) {
                // no prototype found, return an unscripted wrapper
                wrapper = new NativeJavaObject(global, e, e.getClass());
            } else {
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

        HopObject hobj = (HopObject) wrappercache.get(node);

        if (hobj == null) {
            String protoname = node.getPrototype();
            Scriptable op = getValidPrototype(protoname);

            // no prototype found for this node
            if (op == null) {
                // maybe this object has a prototype name that has been
                // deleted, but the storage layer was able to set a
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.