Package org.waveprotocol.wave.model.util

Examples of org.waveprotocol.wave.model.util.ReadableStringSet


      @Override public void endAnnotation(String key) {
        ended.add(key);
      }
    };

    ReadableStringSet keyCheck = CollectionUtils.newStringSet("A", "B", "C");
    ReadableStringSet toIgnore = CollectionUtils.newStringSet("B", "D");
    logic.unstripKeys(builder, keyCheck, toIgnore);

    assertEquals(2, ended.countEntries());
    assertTrue(ended.contains("A"));
    assertFalse(ended.contains("B"));
View Full Code Here


      fail();
    } catch (NullPointerException e) {
      // ok
    }

    ReadableStringSet acceptableSet = strs("a");
    ReadableStringSet emptySet = strs();

    // Shouldn't throw.
    m.annotationCursor(0, 0, emptySet);
    m.annotationCursor(0, 0, acceptableSet);
View Full Code Here

  @VisibleForTesting
  String charReference() throws XmlParseException {
    if (match(charReferenceStart)) {
      final int base;
      final ReadableStringSet validDigits;
      if (match('x')) {
        base = 16;
        validDigits = BASE_16_DIGITS;
      } else {
        base = 10;
        validDigits = BASE_10_DIGITS;
      }
      final int start = buffer.getPosition();
      while (validDigits.contains("" + (char) buffer.peek())) {
        buffer.advanceCodeUnit(1);
      }
      final int end = buffer.getPosition();
      ensure(start != end, "empty char reference");
      final int codePoint;
View Full Code Here

   */
  public List<RangedAnnotation<String>> extractNormalizedAnnotation(Point<N> normalizedStart,
      Point<N> normalizedEnd) {
    int start = doc.getLocation(normalizedStart);
    int end = doc.getLocation(normalizedEnd);
    ReadableStringSet interested = filterContentAnnotations(doc.knownKeys());

    return trimAnnotations(doc.rangedAnnotations(start, end, interested), start, end - start);
  }
View Full Code Here

    }
    // This must not be called synchronously in the same key event before the dom is modified.
    EditorTestingUtil.forceFlush(editor);

    StringBuilder ans = new StringBuilder("");
    ReadableStringSet keys = CollectionUtils.newStringSet(
        DiffHighlightingFilter.DIFF_INSERT_KEY,
        DiffHighlightingFilter.DIFF_DELETE_KEY);
    MutableAnnotationSet.Local annotations = editor.getContent().getLocalAnnotations();
    annotations.annotationIntervals(0, annotations.size(), keys);
    for (AnnotationInterval<Object> interval :
View Full Code Here

      StringMap<String> modified = annotationLogic.stripKeys(
          destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);

      // parse the tokens and apply ops
      RichTextMutationBuilder mutationBuilder = new RichTextMutationBuilder(modified);
      ReadableStringSet affectedKeys =
          mutationBuilder.applyMutations(tokenizer, builder, destDoc, insertAt.getContainer());

      // close annotations and finish
      annotationLogic.unstripKeys(builder, modified.keySet(), affectedKeys);
      builder.finish();
View Full Code Here

      int remainingIterations = maxIterations;

      endLocation = getEnd(startLocation, docSize, REPAINT_KEY, "y");

      ReadableStringSet allKeys = getKeys();
      nextChangingKeys = allKeys;
      chunkEnd = startLocation;
      currentValues = new HashMap<String, Object>();
      cursor = localAnnotations.annotationCursor(startLocation, endLocation, allKeys);
      progress();
View Full Code Here

      return true;
    }

    private void progress() {
      ReadableStringSet changingKeys;

      final int start = chunkEnd;

      if (!cursor.hasNext()) {
        chunkEnd = endLocation;
View Full Code Here

          }

          @Override
          public void onDataReady(GadgetMetadata metadata, String securityToken) {
            if (isActive()) {
              ReadableStringSet views = metadata.getViewSet();
              String view =  null;
              if (views.contains(GADGET_PRIMARY_VIEW)) {
                view = GADGET_PRIMARY_VIEW;
              } else if (views.contains(GADGET_DEFAULT_VIEW)) {
                view = GADGET_DEFAULT_VIEW;
              } else if (!views.isEmpty()) {
                view = views.someElement();
              } else {
                showBrokenGadget("Gadget has no view to render.");
                return;
              }
              String url = metadata.getIframeUrl(view);
View Full Code Here

      int remainingIterations = maxIterations;

      endLocation = getEnd(startLocation, docSize, REPAINT_KEY, "y");

      ReadableStringSet allKeys = getKeys();
      nextChangingKeys = allKeys;
      chunkEnd = startLocation;
      currentValues = new HashMap<String, Object>();
      cursor = localAnnotations.annotationCursor(startLocation, endLocation, allKeys);
      progress();
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.util.ReadableStringSet

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.