Package org.waveprotocol.wave.client.editor.content

Examples of org.waveprotocol.wave.client.editor.content.ContentNode.asElement()


    // element or if it is followed by another line element
    ContentElement lineElement = Line.fromParagraph(e).getLineElement();
    CMutableDocument doc = lineElement.getMutableDoc();
    ContentNode next = doc.getNextSibling(lineElement);
    return next == null
        || (next.asElement() != null && LineRendering.isLineElement(next.asElement()));
  }

  @Override
  public boolean handleEnter(ContentElement element, EditorEvent event) {
    ContentPoint contentPoint = event.getCaret();
View Full Code Here


    // element or if it is followed by another line element
    ContentElement lineElement = Line.fromParagraph(e).getLineElement();
    CMutableDocument doc = lineElement.getMutableDoc();
    ContentNode next = doc.getNextSibling(lineElement);
    return next == null
        || (next.asElement() != null && LineRendering.isLineElement(next.asElement()));
  }

  @Override
  public boolean handleEnter(ContentElement element, EditorEvent event) {
    ContentPoint contentPoint = event.getCaret();
View Full Code Here

    if (!isLineElement(firstChild)) {
      errorLogAndThrow("First child not a line element");
      return false;
    }

    ContentElement element = firstChild.asElement();
    boolean first = true;

    while (true) {
      if (line.getParagraph().getPreviousSibling() != line.getLineElement()) {
        errorLogAndThrow("Junk between line token and its paragraph");
View Full Code Here

      }

      ContentNode node;
      for (node = line.getParagraph().getFirstChild(); node != null; node = node.getNextSibling()) {

        ContentElement e = node.asElement();
        if (e != null) {
          if (isLineElement(e)) {
            errorLogAndThrow("Line element stuck inside rendering paragraph: " + e);
            return false;
          }
View Full Code Here

        errorLogAndThrow("Junk after rendering paragraph "
            + line.getParagraph() + ", junk: " + node);
        return false;
      }

      element = node.asElement();
      Line nextLine = Line.fromLineElement(element);
      if (line.next() != nextLine) {
        errorLogAndThrow("Next line doesn't correspond to next line element");
        return false;
      }
View Full Code Here

    if (first == null) {
      return null;
    }

    // go through the lines one by one:
    return Line.fromLineElement(first.asElement());
  }

  public interface LineStyle {
    /**
     * Applies an action to a line based on a button state.
View Full Code Here

      }

      ContentNode node;
      for (node = line.getParagraph().getFirstChild(); node != null; node = node.getNextSibling()) {

        ContentElement e = node.asElement();
        if (e != null) {
          if (isLineElement(e)) {
            errorLogAndThrow("Line element stuck inside rendering paragraph: " + e);
            return false;
          }
View Full Code Here

        errorLogAndThrow("Junk after rendering paragraph "
            + line.getParagraph() + ", junk: " + node);
        return false;
      }

      element = node.asElement();
      Line nextLine = Line.fromLineElement(element);
      if (line.next() != nextLine) {
        errorLogAndThrow("Next line doesn't correspond to next line element");
        return false;
      }
View Full Code Here

    if (first == null) {
      return null;
    }

    // go through the lines one by one:
    return Line.fromLineElement(first.asElement());
  }

  public interface LineStyle {
    /**
     * Applies an action to a line based on a button state.
View Full Code Here

    // element or if it is followed by another line element
    ContentElement lineElement = Line.fromParagraph(e).getLineElement();
    CMutableDocument doc = lineElement.getMutableDoc();
    ContentNode next = doc.getNextSibling(lineElement);
    return next == null
        || (next.asElement() != null && LineRendering.isLineElement(next.asElement()));
  }

  @Override
  public boolean handleEnter(ContentElement element, EditorEvent event) {
    ContentPoint contentPoint = event.getCaret();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.