Package org.waveprotocol.wave.client.wavepanel.view

Examples of org.waveprotocol.wave.client.wavepanel.view.AnchorView


    void verify(Queue<BlipView> blips, BlipView blip) {
      assertEquals(blips.poll(), blip);
      BlipMetaView meta = blip.getMeta();

      AnchorView a = meta.getInlineAnchorAfter(null);
      for (ThreadBuilder threadBuilder : anchored) {
        assertNotNull(a);
        threadBuilder.verify(blips, a.getThread());
        a = meta.getInlineAnchorAfter(a);
      }
      assertNull(a);

      int anchoredDefaults = 0// empty default anchors.
      a = blip.getDefaultAnchorAfter(null);
      for (ThreadBuilder threadBuilder : unanchored) {
        assertNotNull(a);
        InlineThreadView thread = a.getThread();
        while (thread == null) {
          a = blip.getDefaultAnchorAfter(a);
          thread = a.getThread();
          assertNotNull(a);
          anchoredDefaults++;
        }
        threadBuilder.verify(blips, thread);
        a = blip.getDefaultAnchorAfter(a);
      }
      while (a != null) {
        assertNull(a.getThread());
        a = blip.getDefaultAnchorAfter(a);
        anchoredDefaults++;
      }
      assertNull(a);
      assertEquals(anchored.length, anchoredDefaults);
View Full Code Here


  @Override
  public void onAnchorAddedBefore(ConversationBlip blip, ReplyDoodad ref, ReplyDoodad dood) {
    BlipView blipUi = views.getBlipView(blip);
    BlipMetaView metaUi = blipUi != null ? blipUi.getMeta() : null;
    if (metaUi != null) {
      AnchorView inlineUi = dood.getAnchor();
      metaUi.insertInlineAnchorBefore(ref != null ? ref.getAnchor() : null, inlineUi);

      // Move reply if it exists.
      ConversationThread reply = blip.getReplyThread(dood.getId());
      AnchorView defaultUi = reply != null ? views.getDefaultAnchor(reply) : null;
      InlineThreadView replyUi = defaultUi != null ? defaultUi.getThread() : null;
      if (replyUi != null) {
        defaultUi.detach(replyUi);
        inlineUi.attach(replyUi);
      }
    }
  }
View Full Code Here

  @Override
  public void onAnchorRemoved(ConversationBlip blip, ReplyDoodad dood) {
    BlipView blipUi = views.getBlipView(blip);
    BlipMetaView metaUi = blip != null ? blipUi.getMeta() : null;
    if (metaUi != null) {
      AnchorView inlineUi = dood.getAnchor();

      // Move reply if there is one.
      ConversationThread reply = blip.getReplyThread(dood.getId());
      AnchorView defaultUi = reply != null ? views.getDefaultAnchor(reply) : null;
      InlineThreadView replyUi = inlineUi.getThread();
      if (replyUi != null) {
        inlineUi.detach(replyUi);
        defaultUi.attach(replyUi);
      }

      dood.getAnchor().remove();
    }
  }
View Full Code Here

    }
  }

  public InlineThreadView presentAfter(BlipView blipUi, ConversationThread ref,
      ConversationThread thread) {
    AnchorView refDefault = ref != null ? views.getDefaultAnchor(ref) : null;
    Preconditions.checkArgument(ref == null || refDefault != null, "ref is not rendered");

    // Render thread in default anchor (and move to inline if there is one).
    AnchorView defaultUi = blipUi.insertDefaultAnchorAfter(refDefault, thread);
    InlineThreadView threadUi = defaultUi.getThread();
    AnchorView inlineUi = views.getInlineAnchor(thread);
    if (inlineUi != null) {
      defaultUi.detach(threadUi);
      inlineUi.attach(threadUi);
    }
    return threadUi;
  }
View Full Code Here

    // inline -> default location mapping.

    StringSequence inlineLocators = metaDom.getInlineLocators();
    String inlineId = inlineLocators.getFirst();
    while (inlineId != null) {
      AnchorView inlineUi = views.asAnchor(Document.get().getElementById(inlineId));
      InlineThreadView threadUi = inlineUi.getThread();
      if (threadUi != null) {
        // Move to default location.
        String defaultId = ViewIdMapper.defaultOfInlineAnchor(inlineId);
        AnchorView defaultUi = views.asAnchor(Document.get().getElementById(defaultId));
        inlineUi.detach(threadUi);
        defaultUi.attach(threadUi);
      }

      inlineId = inlineLocators.getNext(inlineId);
    }
  }
View Full Code Here

  private BlipView getNextPost(BlipView parent, BlipMetaView meta) {
    return getNextPost(parent, (AnchorView) null);
  }

  private BlipView getNextPost(BlipView parent, AnchorView anchor) {
    AnchorView next = parent.getDefaultAnchorAfter(anchor);
    return (next != null) ? getNextPre(parent, next) : getNextPost(parent,
        (InlineConversationView) null);
  }
View Full Code Here

    InlineConversationView next = parent.getConversationAfter(conversation);
    return (next != null) ? getNextPre(parent, next) : getNextPost(parent.getParent(), parent);
  }

  private BlipView getNextPost(BlipMetaView parent, AnchorView anchor) {
    AnchorView next = parent.getInlineAnchorAfter(anchor);
    return next != null ? getNextPre(parent, next) : getNextPost(parent.getParent(), parent);
  }
View Full Code Here

    BlipView last = skip(thread) ? null : thread.getBlipBefore(null);
    return last != null ? getPrevPre(thread, last) : getPrevPost(parent, thread);
  }

  private BlipView getPrevPre(BlipView parent, BlipMetaView meta) {
    AnchorView last = meta.getInlineAnchorBefore(null);
    return last != null ? getPrevPre(meta, last) : getPrevPost(parent, meta);
  }
View Full Code Here

  private BlipView getPrevPost(TopConversationView parent, RootThreadView child) {
    return null;
  }

private BlipView getPrevPost(BlipView parent, AnchorView child) {
    AnchorView prev = parent.getDefaultAnchorBefore(child);
    BlipMetaView meta;
    return prev != null ? getPrevPre(parent, prev) // \u2620
        : ((meta = parent.getMeta()) != null) // \u2620
            ? getPrevPre(parent, meta) // \u2620
            : getPrevPost(parent, meta);
View Full Code Here

    InlineConversationView prev = parent.getConversationBefore(child);
    return prev != null ? getPrevPre(parent, prev) : getPrevPost(parent, (AnchorView) null);
  }

  private BlipView getPrevPost(BlipMetaView parent, AnchorView child) {
    AnchorView prev = parent.getInlineAnchorBefore(child);
    return prev != null ? getPrevPre(parent, prev) : getPrevPost(parent.getParent(), parent);
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.wavepanel.view.AnchorView

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.