Examples of NativeObject


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

        VarArgParser.Arguments parsedArgs = _loadObjectDefVarags.parse(args);

        TMLContext context = fetchInitialContext(cx);
        String actionID = (String) parsedArgs.get("id");
        NativeObject currentObject = (NativeObject) parsedArgs.get("currentObject");

        // Get the function def (might need to expand local name by the name of
        // the current action)
        TMLAction.Locator actionLocator = determineActionLocator(cx, currentObject, context, actionID);
View Full Code Here

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

        VarArgParser.Arguments parsedArgs = WGAGlobal._loadObjectDefVarags.parse(args);

        TMLContext context = WGAGlobal.fetchInitialContext(cx);
        String actionID = (String) parsedArgs.get("id");
        NativeObject currentObject = (NativeObject) parsedArgs.get("currentObject");

        // Get the function def (might need to expand local name by the name of
        // the current action)
        // Locate object definition
        TMLAction action = null;
View Full Code Here

Examples of js.lang.NativeObject

     * @return
     */
    @JavascriptNativeProperty
    public NativeObject parse(String text) {
        try {
            return parse(new NativeObject(), script.eval("a=" + text));
        } catch (ScriptException e) {
            // If this exception will be thrown, it is bug of this program. So we must rethrow the
            // wrapped error in here.
            throw new Error(e);
        }
View Full Code Here

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

        ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
        NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();

        for (int i = 0; i < array.getLength(); i++) {
            NativeObject object = (NativeObject) array.get(i, array);
            String data = null;
            Object dataObject = object.get("data", object);

            if (!(dataObject instanceof Undefined)) {
                data = (String) dataObject;
            }

            Object startTimeObject = object.get("startTime", object);
            Double startTime =  startTimeObject instanceof Double ? (Double) startTimeObject : Double.NaN;
            Object endTimeObject = object.get("endTime", object);
            Double endTime =  endTimeObject instanceof Double ? (Double) endTimeObject : Double.NaN;
            Object aborted = object.get("aborted", object);
            boolean abortedBoolean = aborted instanceof Boolean && (Boolean) aborted;

            result.addData(new RequestData(data, startTime, endTime, abortedBoolean));
        }
View Full Code Here

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

            } catch (ScriptException e2) {
                // both methods throws exceptions - it's ok.
                Throwable cause = e2.getCause();
                assertTrue(cause instanceof JavaScriptException);
                if (!getOptions().containsKey(IGNORE_MESSAGE)) {
                    NativeObject value = (NativeObject) ((JavaScriptException) cause).getValue();
                    assertEquals(e.getFacesMessage().getDetail(), value.get("detail"));
                    assertEquals(e.getFacesMessage().getSummary(), value.get("summary"));
                }
            }
        }
    }
View Full Code Here

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

                fail("Client-side converted didn't throw exception for value:" + criteria.getValue());
            } catch (ScriptException jsException) {
                // Test passed
                Throwable cause = jsException.getCause();
                assertTrue(cause instanceof JavaScriptException);
                NativeObject value = (NativeObject) ((JavaScriptException) cause).getValue();

                String facesMessageDetail = unifyMessage(e.getFacesMessage().getDetail());
                String facesMessageSummary = unifyMessage(e.getFacesMessage().getSummary());

                String javaScriptMessageDetail = unifyMessage((String) value.get("detail"));
                String javaScriptMessageSummary = unifyMessage((String) value.get("summary"));

                assertEquals(facesMessageDetail, javaScriptMessageDetail);
                assertEquals(facesMessageSummary, javaScriptMessageSummary);
            }
        }
View Full Code Here

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

    for (int i = 0, j = arguments.length; i < j; i++) {
      String resourceUri;
      double logLevel = 0;

      if (arguments[i].getClass().equals(NativeObject.class)) {
        final NativeObject nativeObject = (NativeObject)arguments[i];

        Validate.isTrue(nativeObject.has("url", scope), "The url parameter " +
        "doesn't exists.");

        resourceUri = (String)nativeObject.get("url", scope);

        if (nativeObject.has("logLevel", scope)) {
          logLevel = (Double)nativeObject.get("logLevel", scope);
        }
      } else {
        resourceUri = (String)arguments[i];
      }
View Full Code Here

Examples of org.mozilla.javascript.NativeObject

        // unwrap if argument is a Wrapper
        if (arg instanceof Wrapper) {
            arg = ((Wrapper) arg).unwrap();
        }
        if (arg instanceof NativeObject) {
            NativeObject no = (NativeObject) arg;
            Object[] ids = no.getIds();
            Hashtable ht = new Hashtable(ids.length*2);
            for (int i=0; i<ids.length; i++) {
                if (ids[i] instanceof String) {
                    String key = (String) ids[i];
                    Object o = no.get(key, no);
                    if (o != null) {
                        ht.put(key, processXmlRpcResponse(o));
                    }
                }
            }
View Full Code Here

Examples of org.mozilla.javascript.NativeObject

    Emmet jse = Emmet.getSingleton();
    Scriptable tabstopData = (Scriptable) jse.execJSFunction("javaExtractTabstops", text);
    if (tabstopData != null) {
      text = Context.toString(ScriptableObject.getProperty(tabstopData, "text"));
      NativeArray tabstops = (NativeArray) ScriptableObject.getProperty(tabstopData, "tabstops");
      NativeObject tabstopItem;
      for (int i = 0; i < tabstops.getLength(); i++) {
        tabstopItem = (NativeObject) ScriptableObject.getProperty(tabstops, i);
        addTabStopToGroup(
            Context.toString(ScriptableObject.getProperty(tabstopItem, "group")),
            (int) Context.toNumber(ScriptableObject.getProperty(tabstopItem, "start")),
View Full Code Here

Examples of org.mozilla.javascript.NativeObject

  }
 
  private static ArrayList<AbstractMenuItem> itemsFromJSArray(NativeArray ar) {
    ArrayList<AbstractMenuItem> list = new ArrayList<AbstractMenuItem>();
   
    NativeObject menuItem;
    for (int i = 0; i < ar.getLength(); i++) {
      menuItem = (NativeObject) ScriptableObject.getProperty(ar, i);
      if (Context.toString(ScriptableObject.getProperty(menuItem, "type")).equals("action")) {
        list.add(new Action(menuItem));
      } else {
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.