Examples of HtmlPoint


Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

  protected Point<Node> hpoint(Text node, int offset) {
    return Point.inText((Node)node, offset);
  }

  protected Point<Node> hpoint(ContentTextNode node, int offset) throws HtmlMissing {
    HtmlPoint hpointOutput = new HtmlPoint(null, 0);
    node.findNodeletWithOffset(offset, hpointOutput);
    return Point.inText(hpointOutput.getNode(), hpointOutput.getOffset());
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

   * @param point
   * @return point of nodelet
   */
  public Point<Node> wrapperPointToNodeletPoint(Point<ContentNode> point) {
    if (point.isInTextNode()) {
      HtmlPoint output = wrapperTextPointToHtmlPoint(point);
      return Point.inText(output.getNode(), output.getOffset());
    } else {
      return wrapperElementPointToNodeletPoint(point);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

      return wrapperElementPointToNodeletPoint(point);
    }
  }

  private HtmlPoint wrapperTextPointToHtmlPoint(Point<ContentNode> point) {
    HtmlPoint output = new HtmlPoint(null, 0);
    for (int attempt = 1; attempt <= 2; attempt++) {
      try {
        ((ContentTextNode) point.getContainer()).findNodeletWithOffset(
            point.getTextOffset(), output);
        break;
      } catch (HtmlMissing e) {
        repairer.handle(e);
      }
    }
    if (output.getNode() == null) {
      // TODO(danilatos): Something sensible
      throw new EditorRuntimeException("Don't know what to do with this - offset too big? point: "
          + point);
    }
    return output;
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

   * @param point point of node
   * @return htmlpoint
   */
  public static HtmlPoint nodeletPointToHtmlPoint(Point<Node> point) {
    if (point.isInTextNode()) {
      return new HtmlPoint(point.getContainer(), point.getTextOffset());
    } else {
      return point.getNodeAfter() == null
          ? new HtmlPoint(point.getContainer(), point.getContainer().getChildCount())
          : new HtmlPoint(point.getContainer(), DomHelper.findChildIndex(point.getNodeAfter()));
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

   * @param point
   * @return point of nodelet
   */
  public Point<Node> wrapperPointToNodeletPoint(Point<ContentNode> point) {
    if (point.isInTextNode()) {
      HtmlPoint output = wrapperTextPointToHtmlPoint(point);
      return Point.inText(output.getNode(), output.getOffset());
    } else {
      return wrapperElementPointToNodeletPoint(point);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

      return wrapperElementPointToNodeletPoint(point);
    }
  }

  private HtmlPoint wrapperTextPointToHtmlPoint(Point<ContentNode> point) {
    HtmlPoint output = new HtmlPoint(null, 0);
    for (int attempt = 1; attempt <= 2; attempt++) {
      try {
        ((ContentTextNode) point.getContainer()).findNodeletWithOffset(
            point.getTextOffset(), output);
        break;
      } catch (HtmlMissing e) {
        repairer.handle(e);
      }
    }
    if (output.getNode() == null) {
      // TODO(danilatos): Something sensible
      throw new EditorRuntimeException("Don't know what to do with this - offset too big? point: "
          + point);
    }
    return output;
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.HtmlPoint

   * @param point point of node
   * @return htmlpoint
   */
  public static HtmlPoint nodeletPointToHtmlPoint(Point<Node> point) {
    if (point.isInTextNode()) {
      return new HtmlPoint(point.getContainer(), point.getTextOffset());
    } else {
      return point.getNodeAfter() == null
          ? new HtmlPoint(point.getContainer(), point.getContainer().getChildCount())
          : new HtmlPoint(point.getContainer(), DomHelper.findChildIndex(point.getNodeAfter()));
    }
  }
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.