Examples of HtmlView


Examples of cc.concurrent.config.server.util.HtmlView

    @RequestMapping(value = "/{appName}/{fileName}/{newVersion}/diff/{oldVersion}", method = RequestMethod.GET)
    public String diff(@PathVariable("appName") String appName, @PathVariable("fileName") String fileName,
                             @PathVariable("newVersion") int newVersion,  @PathVariable("oldVersion") int oldVersion,
                             Model model) {
        checkArgument(newVersion > oldVersion, "newVersion must larger than oldVersion");
        HtmlView htmlView = fileService.diff(appName, fileName, newVersion, oldVersion);
        model.addAttribute("appName", appName);
        model.addAttribute("fileName", fileName);
        model.addAttribute("newVersion", newVersion);
        model.addAttribute("oldVersion", oldVersion);
        model.addAttribute("newHtml", htmlView.getNewHtml());
        model.addAttribute("oldHtml", htmlView.getOldHtml());
        return "diff";
    }
View Full Code Here

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

    // Attempt to associate our location with a node
    // This should be a last resort, ideally we should be given selections
    // in the correct text node, when the selection is at a text node boundary
    if (node == null) {
      HtmlView filteredHtml = filteredHtmlView;
      Node nodeBefore = Point.nodeBefore(filteredHtml, previousSelectionStart.asElementPoint());
      Node nodeAfter = previousSelectionStart.getNodeAfter();
      //TODO(danilatos): Usually we would want nodeBefore as a preference, but
      // not always...
      if (nodeBefore != null && DomHelper.isTextNode(nodeBefore)) {
View Full Code Here

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

     */
    private void startTypingSequence(Point.Tx<Node> previousSelectionStart)
        throws HtmlMissing, HtmlInserted {
      Text node = previousSelectionStart.getContainer().cast();
      ContentView renderedContent = renderedContentView;
      HtmlView filteredHtml = filteredHtmlView;
      try {
        // This might throw an exception
        ContentTextNode wrapper = manager.findTextWrapper(node, true);

        // No exception -> already a wrapper for this node (we're editing some existing text)
        firstWrapper = wrapper;
        lastWrapper = wrapper;

        checkNeighbouringTextNodes(previousSelectionStart);

        contentRange = RestrictedRange.around(renderedContent, firstWrapper, lastWrapper);

        // Ensure methods we call on the text node operate on the same view as us
        assert wrapper.getFilteredHtmlView() == filteredHtml;

        Node htmlNodeBefore = filteredHtml.getPreviousSibling(firstWrapper.getImplNodelet());
        Element htmlParent = filteredHtml.getParentElement(node);
        ContentNode cnodeAfter = contentRange.getNodeAfter();
        Node htmlNodeAfter = cnodeAfter == null ? null : cnodeAfter.getImplNodelet();
        htmlRange = RestrictedRange.between(
            htmlNodeBefore, Point.inElement(htmlParent, htmlNodeAfter));

        if (partOfMutatingRange(filteredHtml.asText(previousSelectionStart.getContainer()))) {
          // This must be true if getWrapper worked correctly. Program error
          // otherwise (not browser error)
          assert firstWrapper.getImplNodelet() == htmlRange.getStartNode(filteredHtml);

          // NOTE(danilatos): We are asking the firstWrapper to give us the offset of
View Full Code Here

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

        return;
      }
      try {
        searchingForAdjacentArea = true;

        HtmlView filteredHtml = filteredHtmlView;
        ContentView renderedContent = renderedContentView;

        // Is this method slow? we need it often enough, but not in 95% of scenarios,
        // so there is room to optimise.

        // See if there are other text nodes we should check
        Text selNode = previousSelectionStart.getContainer().cast();
        int selOffset = previousSelectionStart.getTextOffset();

        // TODO(patcoleman): see if being zero here is actually a problem.
        // assert selNode.getLength() > 0;

        if (selOffset == 0 && firstWrapper.getImplNodelet() == selNode) {
          // if we are at beginning of mutating node
          ContentNode prev = renderedContent.getPreviousSibling(firstWrapper);
          if (prev != null && prev.isTextNode()) {
            firstWrapper = (ContentTextNode)prev;
          }
        } else {
          ContentNode nextNode = renderedContent.getNextSibling(lastWrapper);
          Node nextNodelet = nextNode != null ? nextNode.getImplNodelet() : null;
          if (selOffset == selNode.getLength() &&
              filteredHtml.getNextSibling(selNode) == nextNodelet) {
            // if we are at end of mutating node
            if (nextNode != null && nextNode.isTextNode()) {
              lastWrapper = (ContentTextNode)nextNode;
            }
          }
View Full Code Here

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

    /**
     * @return The current value of the text in the html, within our tracked range
     */
    private String calculateNewValue() {
      HtmlView filteredHtml = filteredHtmlView;
      Text fromIncl = htmlRange.getStartNode(filteredHtml).cast();
      Node toExcl = htmlRange.getPointAfter().getNodeAfter();

      return ContentTextNode.sumTextNodes(fromIncl, toExcl, filteredHtml);
    }
View Full Code Here

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

      if (partOfMutatingRange(point.getContainer())) {
        // TODO(danilatos): check for mutatingNodeOwns duplicates a loop which
        // is done in getOffset
        Text toFind = point.getContainer().<Text>cast();
        HtmlView filteredHtml = filteredHtmlView;

        return ContentTextNode.getOffset(
            toFind,
            htmlRange.getStartNode(filteredHtml).<Text>cast(),
            htmlRange.getNodeAfter(),
View Full Code Here

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

        if (!editorHtml.isOrHasChild(selection.getFirst().getContainer()) ||
             editorHtml.isOrHasChild(selection.getSecond().getContainer())) {
          selection = null; // outside!
        }
      }
      HtmlView view = editor.getContent().getRawHtmlView();
      Point<Node> selStart = (selection != null) ? selection.getFirst() : null;
      Point<Node> selEnd = (selection != null) ? selection.getSecond() : null;
      return new Pretty<Node>().select(selStart, selEnd).print(view);
    } else {
      EditorStaticDeps.logger.error().logPlainText(
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
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.