Package org.waveprotocol.wave.client.common.safehtml

Examples of org.waveprotocol.wave.client.common.safehtml.SafeHtmlBuilder.toSafeHtml()


          timeHtml.appendEscaped("" + value);
          timeHtml.appendHtmlConstant("</td></tr>");
        }
      });
      timeHtml.appendHtmlConstant("</table>");
      timeBox.setInnerHTML(timeHtml.toSafeHtml().asString());

    }
  }
}
View Full Code Here


  public SafeHtml getResult() {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    for (ResultProducingRenderHelper<? extends UiBuilder> h : helpers) {
      h.getResult().outputHtml(builder);
    }
    return builder.toSafeHtml();
  }

  @Override
  public void end() {
    for (ResultProducingRenderHelper<?> h : helpers) {
View Full Code Here

      collection.add(new SimpleUiBuilder(content));
      expected.append(content);
    }
    SafeHtmlBuilder output = new SafeHtmlBuilder();
    collection.outputHtml(output);
    assertEquals(expected.toString(), output.toSafeHtml().asString());
  }
}
View Full Code Here

   * Renders an HTML closure to HTML.
   */
  public static String render(HtmlClosure html) {
    SafeHtmlBuilder output = new SafeHtmlBuilder();
    html.outputHtml(output);
    return output.toSafeHtml().asString();
  }

  /**
   * Verifies that an HTML closure produces well formed HTML, and that it
   * includes all its components.
View Full Code Here

  public void setAvatars(Iterable<Profile> profiles) {
    SafeHtmlBuilder html = new SafeHtmlBuilder();
    for (Profile profile : profiles) {
      renderAvatar(html, profile);
    }
    avatars.setInnerHTML(html.toSafeHtml().asString());
  }

  @Override
  public void setTitleText(String title) {
    this.title.setInnerText(title);
View Full Code Here

    SafeHtmlBuilder html = new SafeHtmlBuilder();
    html.appendHtmlConstant("<span class='" + css.unreadCount() + "'>");
    html.appendHtmlConstant(String.valueOf(unread));
    html.appendHtmlConstant("</span>");
    html.appendHtmlConstant(" " + messages.of(total));
    return html.toSafeHtml();
  }

  private SafeHtml renderReadMessages(int total) {
    SafeHtmlBuilder html = new SafeHtmlBuilder();
    html.appendHtmlConstant(String.valueOf(total));
View Full Code Here

  private SafeHtml renderReadMessages(int total) {
    SafeHtmlBuilder html = new SafeHtmlBuilder();
    html.appendHtmlConstant(String.valueOf(total));
    html.appendHtmlConstant(" " + messages.msgs());
    return html.toSafeHtml();
  }

  private void renderAvatar(SafeHtmlBuilder html, Profile profile) {
    // URL is trusted to be attribute safe (i.e., no ' or ")
    String url = profile.getImageUrl();
View Full Code Here

            if (error != null) {
              stack.appendHtmlConstant("Caused by: ");
            }
          }

          whenReady.use(stack.toSafeHtml());
        }
      }.schedule(1);
    }

    private static String maybe(String value, String otherwise) {
View Full Code Here

      return null;
    }
    SafeHtmlBuilder html = new SafeHtmlBuilder();
    ui.outputHtml(html);
    Element div = com.google.gwt.dom.client.Document.get().createDivElement();
    div.setInnerHTML(html.toSafeHtml().asString());
    Element ret = div.getFirstChildElement();
    // Detach, in order that this element looks free-floating (required by some
    // preconditions).
    ret.removeFromParent();
    return ret;
View Full Code Here

        SafeHtmlBuilder builder = new SafeHtmlBuilder();
        builder.append(START_SUGGEST_LINK);
        builder.append(title);
        builder.append(END_SUGGEST_LINK);

        return menu.addItem(builder.toSafeHtml(), callback);
      }

      @Override
      public MenuItem addItem(String title, Command callback) {
        return addItem(EscapeUtils.fromString(title), callback);
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.