Examples of HtmlView


Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

    if (first.getLength() == getLength()) {
      return;
    }

    ContentNode next = checkNodeAndNeighbour(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    //String sum = "";
    Node nextImpl = (next == null) ? null : next.getImplNodelet();
    for (Text nodelet = first; nodelet != nextImpl && nodelet != null;
        nodelet = filteredHtml.getNextSibling(first).cast()) {
      //sum += nodelet.getData();
      if (nodelet != first) {
        getExtendedContext().editing().textNodeletAffected(
            nodelet, -1000, -1000, TextNodeChangeType.REMOVE);
        nodelet.removeFromParent();
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * @return true if textNodelet is owned by this wrapper
   * @throws HtmlMissing
   */
  public boolean owns(Text textNodelet) throws HtmlMissing {
    ContentNode next = checkNodeAndNeighbour(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    Node nextImpl = (next == null) ? null : next.getImplNodelet();
    for (Text nodelet = getImplNodelet(); nodelet != nextImpl;
        nodelet = filteredHtml.getNextSibling(nodelet).cast()) {
      if (nodelet == textNodelet) {
        return true;
      }
    }

View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * Same as {@link #findNodeletWithOffset(int, HtmlPoint)}, but does not do
   * a consistency check. Instead it accepts the impl nodelet of the next
   * wrapper (or null) and assumes everthing is consistent.
   */
  public void findNodeletWithOffset(int offset, HtmlPoint output, Node nextImpl) {
    HtmlView filteredHtml = getFilteredHtmlView();

    int sum = 0;
    int prevSum;
    for (Text nodelet = getImplNodelet(); nodelet != nextImpl;
        nodelet = filteredHtml.getNextSibling(nodelet).cast()) {
      prevSum = sum;
      sum += nodelet.getLength();
      if (sum >= offset) {
        output.setNode(nodelet);
        output.setOffset(offset - prevSum);
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

    EditorStaticDeps.startIgnoreMutations();
    try {

      boolean ret = false;
      ContentView renderedContent = getRenderedContentView();
      HtmlView filteredHtml = getFilteredHtmlView();

      ContentNode node = from;
      Node nodelet;
      if (node == null) {
        node = renderedContent.getFirstChild(this);
        nodelet = filteredHtml.getFirstChild(getImplNodelet());
      } else {
        nodelet = node.getImplNodelet();
      }

      while (node != null) {

        if (node.getImplNodelet() != nodelet) {
          node.setImplNodelet(nodelet);
        }

        if (DomHelper.isTextNode(nodelet)) {
          String target = ((ContentTextNode) node).getData();
          String txt = nodelet.<Text>cast().getData();
          String nodeletData = txt;
          int left = target.length() - txt.length();
          while (left > 0) {
            nodelet = filteredHtml.getNextSibling(nodelet);
            assert DomHelper.isTextNode(nodelet) : "Some random element!";
            nodeletData = nodelet.<Text>cast().getData();
            // TODO(danilatos): Is a StringBuilder more efficient here? On average, how many
            // string concatenations are expected?
            txt += nodeletData;
            left -= nodeletData.length();
          }
          assert target.equals(ContentTextNode.getNodeValueFromHtmlString(
                  txt.substring(0, target.length()))) : "Content & html text don't match!";
          if (left < 0) {
            if (nodelet.equals(notifyIfSplit)) {
              ret = true;
            }
            nodelet.<Text>cast().splitText(nodeletData.length() + left);
          }
        }

        nodelet = filteredHtml.getNextSibling(nodelet);
        node = renderedContent.getNextSibling(node);

        if (node == to) {
          break;
        }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

        } else {
          // General case
          Node toExcl = implSplitText(offset + count);
          Node fromIncl = implSplitText(offset);

          HtmlView filteredHtml = getFilteredHtmlView();
          for (Node node = fromIncl; node != toExcl && node != null;) {
            Node next = filteredHtml.getNextSibling(node);
            node.removeFromParent();
            node = next;
          }
        }
      } else {
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * @return the calculated character data in the html
   * @throws HtmlMissing
   */
  public String getImplData() throws HtmlMissing {
    Node next = checkNodeAndNeighbourReturnImpl(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    return sumTextNodes(getImplNodelet(), next, filteredHtml);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * @return length of character data in the html
   * @throws HtmlMissing
   */
  public int getImplDataLength() throws HtmlMissing {
    Node next = checkNodeAndNeighbourReturnImpl(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    return sumTextNodesLength(getImplNodelet(), next, filteredHtml);
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

    if (first.getLength() == getLength()) {
      return;
    }

    ContentNode next = checkNodeAndNeighbour(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    //String sum = "";
    Node nextImpl = (next == null) ? null : next.getImplNodelet();
    for (Text nodelet = first; nodelet != nextImpl && nodelet != null;
        nodelet = filteredHtml.getNextSibling(first).cast()) {
      //sum += nodelet.getData();
      if (nodelet != first) {
        getExtendedContext().editing().textNodeletAffected(
            nodelet, -1000, -1000, TextNodeChangeType.REMOVE);
        nodelet.removeFromParent();
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * @return true if textNodelet is owned by this wrapper
   * @throws HtmlMissing
   */
  public boolean owns(Text textNodelet) throws HtmlMissing {
    ContentNode next = checkNodeAndNeighbour(this);
    HtmlView filteredHtml = getFilteredHtmlView();

    Node nextImpl = (next == null) ? null : next.getImplNodelet();
    for (Text nodelet = getImplNodelet(); nodelet != nextImpl;
        nodelet = filteredHtml.getNextSibling(nodelet).cast()) {
      if (nodelet == textNodelet) {
        return true;
      }
    }

View Full Code Here

Examples of org.waveprotocol.wave.client.editor.impl.HtmlView

   * Same as {@link #findNodeletWithOffset(int, HtmlPoint)}, but does not do
   * a consistency check. Instead it accepts the impl nodelet of the next
   * wrapper (or null) and assumes everthing is consistent.
   */
  public void findNodeletWithOffset(int offset, HtmlPoint output, Node nextImpl) {
    HtmlView filteredHtml = getFilteredHtmlView();

    int sum = 0;
    int prevSum;
    for (Text nodelet = getImplNodelet(); nodelet != nextImpl;
        nodelet = filteredHtml.getNextSibling(nodelet).cast()) {
      prevSum = sum;
      sum += nodelet.getLength();
      if (sum >= offset) {
        output.setNode(nodelet);
        output.setOffset(offset - prevSum);
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.