Package org.waveprotocol.wave.model.richtext.RichTextTokenizer

Examples of org.waveprotocol.wave.model.richtext.RichTextTokenizer.Type


      ReadableDocument<N, E, T> doc,
      N splitContainer) {
    reset();

    while (tokenizer.hasNext()) {
      Type tokenType = tokenizer.next();

      switch (tokenType) {
        case NEW_LINE:
        case LIST_ITEM:
          handleNewLine(tokenizer, builder, doc, splitContainer,
View Full Code Here


    }
    return affectedKeys;
  }

  private Attributes structuralAttributes(RichTextTokenizer tokenizer) {
    Type currentStructureType = peek();
    List<Attribute> attrList = new ArrayList<Attribute>();

    if (currentStructureType != null) {
      int indent = indentationLevel;
View Full Code Here

    return attributes;
  }

  private <N, E extends N, T extends N> void handleBasicMutation(RichTextTokenizer tokenizer,
      Nindo.Builder builder, ReadableDocument<N, E, T> doc, N splitContainer) {
    Type currentType = tokenizer.getCurrentType();
    switch (currentType) {
      case TEXT:
        if (tokenizer.getData() != null) {
          builder.characters(PermittedCharacters.BLIP_TEXT.coerceString(tokenizer.getData()));
          offset += tokenizer.getData().length();
        }
        break;
      case STYLE_FONT_WEIGHT_START:
        startAnnotation(builder, AnnotationConstants.STYLE_FONT_WEIGHT, tokenizer.getData());
        break;
      case STYLE_FONT_WEIGHT_END:
        endAnnotation(builder, AnnotationConstants.STYLE_FONT_WEIGHT);
        break;
      case STYLE_FONT_STYLE_START:
        startAnnotation(builder, AnnotationConstants.STYLE_FONT_STYLE, tokenizer.getData());
        break;
      case STYLE_FONT_STYLE_END:
        endAnnotation(builder, AnnotationConstants.STYLE_FONT_STYLE);
        break;
      case STYLE_TEXT_DECORATION_START:
        startAnnotation(builder, AnnotationConstants.STYLE_TEXT_DECORATION, tokenizer.getData());
        break;
      case STYLE_TEXT_DECORATION_END:
        endAnnotation(builder, AnnotationConstants.STYLE_TEXT_DECORATION);
        break;
      case STYLE_COLOR_START:
        startAnnotation(builder, AnnotationConstants.STYLE_COLOR, tokenizer.getData());
        break;
      case STYLE_COLOR_END:
        endAnnotation(builder, AnnotationConstants.STYLE_COLOR);
        break;
      case STYLE_BG_COLOR_START:
        startAnnotation(builder, AnnotationConstants.STYLE_BG_COLOR, tokenizer.getData());
        break;
      case STYLE_BG_COLOR_END:
        endAnnotation(builder, AnnotationConstants.STYLE_BG_COLOR);
        break;
      case STYLE_FONT_FAMILY_START:
        startAnnotation(builder, AnnotationConstants.STYLE_FONT_FAMILY, tokenizer.getData());
        break;
      case STYLE_FONT_FAMILY_END:
        endAnnotation(builder, AnnotationConstants.STYLE_FONT_FAMILY);
        break;
      case LINK_START:
        startAnnotation(builder, AnnotationConstants.LINK_MANUAL, tokenizer.getData());
        break;
      case LINK_END:
        endAnnotation(builder, AnnotationConstants.LINK_MANUAL);
        break;
      case UNORDERED_LIST_START:
      case ORDERED_LIST_START:
        push(currentType);
        break;
      case UNORDERED_LIST_END:
      case ORDERED_LIST_END:
        pop();
        break;
      default:
        throw new IllegalStateException("Unhandled token: " +
            currentType.toString());
    }
  }
View Full Code Here

      ReadableDocument<N, E, T> doc,
      N splitContainer) {
    reset();

    while (tokenizer.hasNext()) {
      Type tokenType = tokenizer.next();

      switch (tokenType) {
        case NEW_LINE:
        case LIST_ITEM:
          handleNewLine(tokenizer, builder, doc, splitContainer,
View Full Code Here

    }
    return affectedKeys;
  }

  private Attributes structuralAttributes(RichTextTokenizer tokenizer) {
    Type currentStructureType = peek();
    List<Attribute> attrList = new ArrayList<Attribute>();

    if (currentStructureType != null) {
      int indent = indentationLevel;
View Full Code Here

    return attributes;
  }

  private <N, E extends N, T extends N> void handleBasicMutation(RichTextTokenizer tokenizer,
      Nindo.Builder builder, ReadableDocument<N, E, T> doc, N splitContainer) {
    Type currentType = tokenizer.getCurrentType();
    switch (currentType) {
      case TEXT:
        if (tokenizer.getData() != null) {
          builder.characters(PermittedCharacters.BLIP_TEXT.coerceString(tokenizer.getData()));
          offset += tokenizer.getData().length();
        }
        break;
      case STYLE_FONT_WEIGHT_START:
        startAnnotation(builder, STYLE_KEY_FONT_WEIGHT, tokenizer.getData());
        break;
      case STYLE_FONT_WEIGHT_END:
        endAnnotation(builder, STYLE_KEY_FONT_WEIGHT);
        break;
      case STYLE_FONT_STYLE_START:
        startAnnotation(builder, STYLE_KEY_FONT_STYLE, tokenizer.getData());
        break;
      case STYLE_FONT_STYLE_END:
        endAnnotation(builder, STYLE_KEY_FONT_STYLE);
        break;
      case STYLE_TEXT_DECORATION_START:
        startAnnotation(builder, STYLE_KEY_TEXT_DECORATION, tokenizer.getData());
        break;
      case STYLE_TEXT_DECORATION_END:
        endAnnotation(builder, STYLE_KEY_TEXT_DECORATION);
        break;
      case STYLE_COLOR_START:
        startAnnotation(builder, STYLE_KEY_COLOR, tokenizer.getData());
        break;
      case STYLE_COLOR_END:
        endAnnotation(builder, STYLE_KEY_COLOR);
        break;
      case STYLE_BG_COLOR_START:
        startAnnotation(builder, STYLE_KEY_BG_COLOR, tokenizer.getData());
        break;
      case STYLE_BG_COLOR_END:
        endAnnotation(builder, STYLE_KEY_BG_COLOR);
        break;
      case STYLE_FONT_FAMILY_START:
        startAnnotation(builder, STYLE_KEY_FONT_FAMILY, tokenizer.getData());
        break;
      case STYLE_FONT_FAMILY_END:
        endAnnotation(builder, STYLE_KEY_FONT_FAMILY);
        break;
      case LINK_START:
        startAnnotation(builder, "link/manual", tokenizer.getData());
        break;
      case LINK_END:
        endAnnotation(builder, "link/manual");
        break;
      case UNORDERED_LIST_START:
      case ORDERED_LIST_START:
        push(currentType);
        break;
      case UNORDERED_LIST_END:
      case ORDERED_LIST_END:
        pop();
        break;
      default:
        throw new IllegalStateException("Unhandled token: " +
            currentType.toString());
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.richtext.RichTextTokenizer.Type

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.