Package com.google.gwt.jsonp.client

Examples of com.google.gwt.jsonp.client.JsonpRequestBuilder


                + "<br/>and then reloading in super dev mode");
        VNotification n = new VNotification();
        n.show("<b>Recompiling widgetset, please wait</b>",
                VNotification.CENTERED, VNotification.STYLE_SYSTEM);

        JsonpRequestBuilder b = new JsonpRequestBuilder();
        b.setCallbackParam("_callback");
        b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000);
        b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?"
                + getRecompileParameters(GWT.getModuleName()),
                new AsyncCallback<RecompileResult>() {

                    @Override
                    public void onSuccess(RecompileResult result) {
View Full Code Here


  public void load(C loadConfig, final Callback<JavaScriptObject, Throwable> callback) {
    String transId = "transId" + ID++;
    String prepend = url.indexOf("?") != -1 ? "&" : "?";
    String u = url + prepend + generateUrl(loadConfig);

    JsonpRequestBuilder b = new JsonpRequestBuilder();
    b.setPredeterminedId(transId);// needed?
    b.requestObject(u, new AsyncCallback<JavaScriptObject>() {
      @Override
      public void onFailure(Throwable caught) {
        callback.onFailure(caught);
      }
View Full Code Here

      }
    }

  private void makeJsonpCall() {
    String url = "http://gwtmobile-services.appspot.com/jsonp";
   JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
   jsonp.requestObject(url,
       new AsyncCallback<Hello>() {
         @Override
         public void onFailure(Throwable throwable) {
           text.setHTML("Error: " + throwable);
         }
View Full Code Here

  public void load(C loadConfig, final Callback<JavaScriptObject, Throwable> callback) {
    String prepend = url.indexOf("?") != -1 ? "&" : "?";
    String u = url + prepend + generateUrl(loadConfig);

    JsonpRequestBuilder b = new JsonpRequestBuilder();
    b.requestObject(u, new AsyncCallback<JavaScriptObject>() {
      @Override
      public void onFailure(Throwable caught) {
        callback.onFailure(caught);
      }
View Full Code Here

        this.process = process;
    }

    @Override
    public void call() {
        JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
        jsonp.requestObject(URL, new AsyncCallback<JavaScriptObject>() {
            @Override
            public void onFailure(Throwable caught) {
                process.stdout().write("JSONP request failed: " + caught);
            }
View Full Code Here

  public PromiseReqBuilderJSONP(String url, int timeout) {
    this(url, null, timeout);
  }

  public PromiseReqBuilderJSONP(String url, String callbackParam, int timeout) {
    JsonpRequestBuilder builder = new JsonpRequestBuilder();
    if (timeout > 0) {
      builder.setTimeout(timeout);
    }
    // jQuery allows a parameter callback=? to figure out the callback parameter
    if (callbackParam == null) {
      MatchResult tmp = callbackRegex.exec(url);
      if  (tmp != null && tmp.getGroupCount() == 4) {
        callbackParam = tmp.getGroup(2);
        url = tmp.getGroup(1) + tmp.getGroup(3);
      }
    }
    if (callbackParam != null) {
      builder.setCallbackParam(callbackParam);
    }
    send(builder, url, new AsyncCallback<Object>() {
      public void onFailure(Throwable caught) {
        dfd.reject(caught);
      }
View Full Code Here

      return;
    }

    if (md5Hash != null) {
      // If we have an md5Hash, we should be using JSONP
      JsonpRequestBuilder rb = new JsonpRequestBuilder();
      rb.setPredeterminedId(md5Hash);
      rb.requestObject(url, new ETRCallback(callback));
    } else {
      RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
      try {
        rb.sendRequest("", new ETRCallback(callback));
      } catch (RequestException e) {
        throw new ResourceException(this,
            "Unable to initiate request for external resource", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.jsonp.client.JsonpRequestBuilder

Copyright © 2018 www.massapicom. 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.