Package org.waveprotocol.wave.model.richtext

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


*
*/

public class RichTextTokenizerImplFirefoxTest extends RichTextTokenizerImplTest {
  public void testWhitespaceStrip() {
    RichTextTokenizer tokens = tokenize("  foo  ");
    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "foo");
  }
View Full Code Here


    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "foo");
  }

  public void testNewlineStrip() {
    RichTextTokenizer tokens = tokenize("\nfoo\n");
    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "foo");
  }
View Full Code Here

    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "foo");
  }

  public void testAllowedSpace() {
    RichTextTokenizer tokens = tokenize("Click <a>Here</a>");
    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "Click ");
    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "Here");
  }
View Full Code Here

    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "Here");
  }

  public void testNestedDivs() {
    RichTextTokenizer tokens = tokenize("<div><div><p>bar</p></div></div>");
    assertEquals(RichTextTokenizer.Type.NEW_LINE, tokens.next());
    assertEquals(RichTextTokenizer.Type.TEXT, tokens.next());
    assertEquals(tokens.getData(), "bar");
    assertEquals(RichTextTokenizer.Type.NEW_LINE, tokens.next());
    assertFalse(tokens.hasNext());
  }
View Full Code Here

      }
    } else {
      instrumentor.record(Action.CLIPBOARD_PASTE_FROM_OUTSIDE);

      // initialize tokenizer and builder
      RichTextTokenizer tokenizer = createTokenizer(srcContainer);
      Builder builder = at(pos);

      // handle annotation starts
      StringMap<String> modified = annotationLogic.stripKeys(
          destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);
View Full Code Here

      }
    } else {
      instrumentor.record(Action.CLIPBOARD_PASTE_FROM_OUTSIDE);

      // initialize tokenizer and builder
      RichTextTokenizer tokenizer = createTokenizer(srcContainer);
      Builder builder = at(pos);

      // handle annotation starts
      StringMap<String> modified = annotationLogic.stripKeys(
          destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);
View Full Code Here

TOP

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

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.