Examples of BlipContentFunction


Examples of com.google.wave.api.Function.BlipContentFunction

    assertTrue(blip.getContent().startsWith("\nho la jupiter!"));

    blip.all().delete();
    blip.at(1).insert("world!");

    blip.first("world").insert(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        return Plaintext.of("Hello " + source.getText().length() + " ");
      }
    });
View Full Code Here

Examples of com.google.wave.api.Function.BlipContentFunction

    blip.all().delete();
    blip.append(new Image(url, 100, 100, "Cool pix."));
    blip.append(" some piece of text.");
    assertEquals("\n  some piece of text.", blip.getContent());
    assertEquals(url, ((Image) blip.first(ElementType.IMAGE).value()).getUrl());
    blip.first(ElementType.IMAGE).insertAfter(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        Image matchedImage = (Image) source;
        return Plaintext.of(matchedImage.getUrl());
      }
    });
    assertEquals("\n " + url + " some piece of text.", blip.getContent());

    blip.all().delete();
    blip.append(new Image(url, 100, 100, "Cool pix."));
    blip.append(" some piece of text.");
    assertEquals("\n  some piece of text.", blip.getContent());
    assertEquals(url, ((Image) blip.first(ElementType.IMAGE).value()).getUrl());
    blip.first(ElementType.IMAGE).replace(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        Image matchedImage = (Image) source;
        return new Image(matchedImage.getUrl() + "?query=foo", matchedImage.getWidth(),
            matchedImage.getHeight(), matchedImage.getCaption());
View Full Code Here

Examples of com.google.wave.api.Function.BlipContentFunction

    assertTrue(blip.getContent().startsWith("\nho la jupiter!"));

    blip.all().delete();
    blip.at(1).insert("world!");

    blip.first("world").insert(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        return Plaintext.of("Hello " + source.getText().length() + " ");
      }
    });
View Full Code Here

Examples of com.google.wave.api.Function.BlipContentFunction

    blip.all().delete();
    blip.append(new Image(url, 100, 100, "Cool pix."));
    blip.append(" some piece of text.");
    assertEquals("\n  some piece of text.", blip.getContent());
    assertEquals(url, ((Image) blip.first(ElementType.IMAGE).value()).getUrl());
    blip.first(ElementType.IMAGE).insertAfter(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        Image matchedImage = (Image) source;
        return Plaintext.of(matchedImage.getUrl());
      }
    });
    assertEquals("\n " + url + " some piece of text.", blip.getContent());

    blip.all().delete();
    blip.append(new Image(url, 100, 100, "Cool pix."));
    blip.append(" some piece of text.");
    assertEquals("\n  some piece of text.", blip.getContent());
    assertEquals(url, ((Image) blip.first(ElementType.IMAGE).value()).getUrl());
    blip.first(ElementType.IMAGE).replace(new BlipContentFunction() {
      @Override
      public BlipContent call(BlipContent source) {
        Image matchedImage = (Image) source;
        return new Image(matchedImage.getUrl() + "?query=foo", matchedImage.getWidth(),
            matchedImage.getHeight(), matchedImage.getCaption());
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.