Package org.waveprotocol.wave.model.conversation

Examples of org.waveprotocol.wave.model.conversation.Conversation


  /**
   * @return the root blip of the currently displayed wave.
   */
  public BlipView getOrFindRootBlip() {
    if (rootBlip == null) {
      Conversation conversation  = wave.getRoot();
      if (conversation == null) {
        return null;
      } else {
        ConversationBlip blip = wave.getRoot().getRootThread().getFirstBlip();
        BlipView rootBlipUi = views.getBlipView(blip);
View Full Code Here


   */
  public BlipView selectBlipByWaveRef(WaveRef waveRef) {
    // Determine if waveRef has a documentId in it - if so, the referenced blip
    // should receive the focus on wave load.
    // First find conversation
    Conversation conversation;
    String documentId = null;
    if (waveRef != null && waveRef.hasWaveletId()) {
      String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
      documentId = waveRef.getDocumentId();
      conversation = wave.getConversation(id);
View Full Code Here

    WaveViewImpl<?> wave = WaveViewImpl.create(
        waveletFactory, waveData.getWaveId(), gen, creator, WaveletConfigurator.ADD_CREATOR);

    // Build a conversation with a root blip.
    ConversationView v = WaveBasedConversationView.create(wave, gen);
    Conversation c = v.createRoot();
    ConversationThread thread = c.getRootThread();
    thread.appendBlip();

    log.info("initial ops=" + ops);

    return ops;
View Full Code Here

        };
      }

      private void maybeNewWaveSetup(StageTwo two, StageThree three) {
        ModelAsViewProvider views = two.getModelAsViewProvider();
        Conversation rootConv = two.getConversations().getRoot();

        if (looksLikeANewWave(rootConv)) {
          BlipView blipUi = views.getBlipView(rootConv.getRootThread().getFirstBlip());

          // Needed because startEditing must have an editor already rendered.
          two.getBlipQueue().flush();
          three.getEditActions().startEditing(blipUi);
        }
      }

      private boolean looksLikeANewWave(Conversation rootConv) {
        return Iterables.size(rootConv.getRootThread().getBlips()) == 1
            && rootConv.getRootThread().getFirstBlip().getContent().size() == 4;
      }
    }.load(null);
  }
View Full Code Here

      Window.alert(e.getMessage());
      return;
    }

    ParticipantsView participantsUi = views.fromAddButton(context);
    Conversation conversation = models.getParticipants(participantsUi);
    for (ParticipantId participant : participants) {
      conversation.addParticipant(participant);
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a blip model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      return c != null ? c.getBlip(parts[1]) : null;
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a thread model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      return c != null ? c.getThread(parts[1]) : null;
    }
  }
View Full Code Here

    String[] parts = split(longId);

    if (parts.length != 2) {
      throw new IllegalArgumentException("Not a participant model id: " + modelId);
    } else {
      Conversation c = model.getConversation(parts[0]);
      ParticipantId p = new ParticipantId(parts[1]);
      return Pair.of(c, p);
    }
  }
View Full Code Here

    this.followPolicy = followPolicy;
  }

  @Override
  public ThreadState getThreadState(ConversationThread thread) {
    Conversation c = thread.getConversation();
    String id = c.getId();
    return supplement.getThreadState(WaveletBasedConversation.widFor(id), thread.getId());
  }
View Full Code Here

      return ids;
    }

    @Override
    public HashedVersion getSignature(WaveletId id) {
      Conversation c = view.getConversation(WaveletBasedConversation.idFor(id));
      return (null != c) ?
          ((WaveletBasedConversation) c).getWavelet().getHashedVersion()
          : HashedVersion.unsigned(0);
    }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.conversation.Conversation

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.