Package org.waveprotocol.wave.client.uibuilder

Examples of org.waveprotocol.wave.client.uibuilder.UiBuilder


    css = UiBuilderTestHelper.mockCss(TopConversationViewBuilder.Css.class);
  }

  public void testAllComponentsPresent() throws Exception {
    String id = "askljfalikwh4rlkhs";
    UiBuilder rootThread = UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<root></root>"));
    UiBuilder participants =
        UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<participants></participants>"));
    FixedConversationViewBuilder builder =
        new FixedConversationViewBuilder(css, id, rootThread, participants);

    UiBuilderTestHelper.verifyHtml(builder, id, Components.values());
View Full Code Here


    constants = UiBuilderTestHelper.mockBlipMessages(BlipMessages.class);
    String blipId = "askljfalikwh4rlkhs";
    String metaDomId = blipId = "M";
    blipDomId = blipId + "B";

    UiBuilder fakeContent = UiBuilder.Constant.of(EscapeUtils.fromSafeConstant(content));
    metaUi = new BlipMetaViewBuilder(css, constants, metaDomId, fakeContent);
    blipUi = new BlipViewBuilder(blipDomId, metaUi, UiBuilder.EMPTY, UiBuilder.EMPTY, css);
  }
View Full Code Here

    css = UiBuilderTestHelper.mockCss(TopConversationViewBuilder.Css.class);
  }

  public void testAllComponentsPresent() throws Exception {
    String id = "askljfalikwh4rlkhs";
    UiBuilder rootThread = UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<root></root>"));
    UiBuilder participants =
        UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<participants></participants>"));
    FlowConversationViewBuilder builder =
        new FlowConversationViewBuilder(css, id, rootThread, participants);

    UiBuilderTestHelper.verifyHtml(builder, id, Components.values());
View Full Code Here

      final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
    HtmlClosure blipsUi = new HtmlClosure() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (ConversationBlip blip : thread.getBlips()) {
          UiBuilder blipUi = blipUis.get(blip);
          // Not all blips are rendered.
          if (blipUi != null) {
            blipUi.outputHtml(out);
          }
        }
      }
    };
    String threadId = viewIdMapper.threadOf(thread);
    String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
    UiBuilder builder = null;
    if (thread.getConversation().getRootThread() == thread) {
      ReplyBoxViewBuilder replyBoxBuilder =
          ReplyBoxViewBuilder.create(replyIndicatorId);
      builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
    } else {
View Full Code Here

  @Override
  public UiBuilder render(final ConversationBlip blip, UiBuilder document,
      final IdentityMap<ConversationThread, UiBuilder> anchorUis,
      final IdentityMap<Conversation, UiBuilder> nestedConversations) {
    UiBuilder threadsUi = new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (ConversationThread thread : blip.getReplyThreads()) {
          anchorUis.get(thread).outputHtml(out);
        }
      }
    };

    UiBuilder convsUi = new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        // Order by conversation id. Ideally, the sort key would be creation
        // time, but that is not exposed in the conversation API.
        final List<Conversation> ordered = CollectionUtils.newArrayList();
View Full Code Here

  /**
   * Creates a builder for a blip menu.
   */
  public static UiBuilder menuBuilder(final Set<MenuOption> options, final Set<MenuOption> selected,
      final BlipViewBuilder.Css css) {
    return new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (MenuOption option : options) {
          out.append(EscapeUtils.fromSafeConstant("|"));
          String style = selected.contains(option) //
View Full Code Here

   *
   * @param options options to include in the menu
   * @param selected which options, if any, are to be selected.
   */
  private void setMenuState(Set<MenuOption> options, Set<MenuOption> selected) {
    UiBuilder builder = BlipMetaViewBuilder.menuBuilder(options, selected, css);
    SafeHtmlBuilder  out = new SafeHtmlBuilder();
    builder.outputHtml(out);
    getMenu().setInnerHTML(out.toSafeHtml().asString());
  }
View Full Code Here

      final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
    HtmlClosure blipsUi = new HtmlClosure() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (ConversationBlip blip : thread.getBlips()) {
          UiBuilder blipUi = blipUis.get(blip);
          // Not all blips are rendered.
          if (blipUi != null) {
            blipUi.outputHtml(out);
          }
        }
      }
    };
    String threadId = viewIdMapper.threadOf(thread);
    String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
    UiBuilder builder = null;
    if (thread.getConversation().getRootThread() == thread) {
      ReplyBoxViewBuilder replyBoxBuilder =
          ReplyBoxViewBuilder.create(replyIndicatorId);
      builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
    } else {
View Full Code Here

  @Override
  public UiBuilder render(final ConversationBlip blip, UiBuilder document,
      final IdentityMap<ConversationThread, UiBuilder> anchorUis,
      final IdentityMap<Conversation, UiBuilder> nestedConversations) {
    UiBuilder threadsUi = new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (ConversationThread thread : blip.getReplyThreads()) {
          anchorUis.get(thread).outputHtml(out);
        }
      }
    };

    UiBuilder convsUi = new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        // Order by conversation id. Ideally, the sort key would be creation
        // time, but that is not exposed in the conversation API.
        final List<Conversation> ordered = CollectionUtils.newArrayList();
View Full Code Here

  /**
   * Creates a builder for a blip menu.
   */
  public static UiBuilder menuBuilder(final Set<MenuOption> options, final Set<MenuOption> selected,
      final BlipViewBuilder.Css css) {
    return new UiBuilder() {
      @Override
      public void outputHtml(SafeHtmlBuilder out) {
        for (MenuOption option : options) {
          out.append(EscapeUtils.fromSafeConstant("|"));
          String style = selected.contains(option) //
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.uibuilder.UiBuilder

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.