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

Examples of org.waveprotocol.wave.client.editor.content.CMutableDocument.locate()


      CMutableDocument document = editor.getDocument();
      if (document == null) {
        return;
      }
      if (from != -1) {
        Point<ContentNode> point = document.locate(from);
        document.insertXml(point, xml);
      } else {
        LineContainers.appendLine(document, xml);
      }
    }
View Full Code Here


                  selection = editor.getSelectionHelper().getSelectionPoints();
                  if (selection != null) {
                    point = selection.getFocus();
                  } else {
                    // Still no selection.  Oh well, put it at the end.
                    point = doc.locate(doc.size() - 1);
                  }
                }
                XmlStringBuilder content = ImageThumbnail.constructXml(attachmentId, fileName);
                ImageThumbnailWrapper thumbnail = ImageThumbnailWrapper.of(doc.insertXml(point, content));
                thumbnail.setAttachmentId(attachmentId);
View Full Code Here

    if (secondAttrs.isEmpty()) {
      secondAttrs = Attributes.EMPTY_MAP;
    }

    ContentElement newLineElement = doc.createElement(
        doc.locate(doc.getLocation(point)), LineContainers.LINE_TAGNAME, secondAttrs);

    ContentElement newLocalParagraph = Line.fromLineElement(newLineElement).getParagraph();
    element.getSelectionHelper().setCaret(
        Point.start(element.getRenderedContentView(), newLocalParagraph));
View Full Code Here

      selection = context.getSelectionHelper().getSelectionPoints();
      if (selection != null) {
        point = selection.getFocus();
      } else {
        // Still no selection.  Oh well, put it at the end.
        point = doc.locate(doc.size() - 1);
      }
    }
    XmlStringBuilder content = ImageThumbnail.constructXml(null, filename);
    thumbnail = ImageThumbnailWrapper.of(doc.insertXml(point, content));
  }
View Full Code Here

      CMutableDocument document = editor.getDocument();
      if (document == null) {
        return;
      }
      if (from != -1) {
        Point<ContentNode> point = document.locate(from);
        document.insertXml(point, xml);
      } else {
        LineContainers.appendLine(document, xml);
      }
    }
View Full Code Here

                int to = -1;
                int docSize = editor.getDocument().size();
                if (cursorLoc != -1) {
                  // Insert the attachment at the cursor location.
                  CMutableDocument doc = editor.getDocument();
                  Point<ContentNode> point = doc.locate(cursorLoc);
                  doc.insertXml(point, xml);
                } else {
                  LineContainers.appendLine(editor.getDocument(), xml);
                }
                // Calculate the link length for the attachment.
View Full Code Here

    if (secondAttrs.isEmpty()) {
      secondAttrs = Attributes.EMPTY_MAP;
    }

    ContentElement newLineElement = doc.createElement(
        doc.locate(doc.getLocation(point)), LineContainers.LINE_TAGNAME, secondAttrs);

    ContentElement newLocalParagraph = Line.fromLineElement(newLineElement).getParagraph();
    element.getSelectionHelper().setCaret(
        Point.start(element.getRenderedContentView(), newLocalParagraph));
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.