Examples of UrlContext


Examples of com.google.api.gwt.samples.urlshortener.shared.Urlshortener.UrlContext

  /** Demonstrates expanding a short URL by requesting its information. */
  private void expand() {
    String shortUrl = Window.prompt("Enter a short URL", "http://goo.gl/xwrT5");

    // Get a new RequestContext which we will execute.
    UrlContext urlContext = urlShortener.url();

    // Fire a get() request with the short URL we want to expand.
    urlContext.get(shortUrl).fire(new Receiver<Url>() {
      @Override
      public void onSuccess(Url response) {
        Window.alert("Long URL: " + response.getLongUrl() + "\n" //
            + "Short URL: " + response.getId() + "\n" //
            + "Status: " + response.getStatus());
View Full Code Here

Examples of com.google.api.gwt.samples.urlshortener.shared.Urlshortener.UrlContext

    String longUrl = Window.prompt("Enter a long URL",
        "http://gwt-google-apis.googlecode.com/svn/trunk/apis/samples/urlshortener/demo/"
            + "urlshortener.html");

    // Get a new RequestContext which we will execute.
    UrlContext urlContext = urlShortener.url();

    // Create a new Url instance with the longUrl we want to insert.
    Url url = urlContext.create(Url.class).setLongUrl(longUrl);

    // Fire an insert() request with the Url to insert.
    urlContext.insert(url).fire(new Receiver<Url>() {
      @Override
      public void onSuccess(Url response) {
        Window.alert("Long URL: " + response.getLongUrl() + "\n" //
            + "Short URL: " + response.getId() + "\n" //
            + "Status: " + response.getStatus());
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.