Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.Node


  }

  /** {@inheritDoc} */
  @Override
  public Node getFirstChild(Node node) {
    Node n;
    while (maybeStrip(n = node.getFirstChild())) { }
    return n;
  }
View Full Code Here


  }

  /** {@inheritDoc} */
  @Override
  public Node getLastChild(Node node) {
    Node n;
    while (maybeStrip(n = node.getLastChild())) { }
    return n;
  }
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  public Node getNextSibling(Node node) {
    Node n;
    while (maybeStrip(n = node.getNextSibling())) { }
    return n;
  }
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  public Node getPreviousSibling(Node node) {
    Node n;
    while (maybeStrip(n = node.getPreviousSibling())) { }
    return n;
  }
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  public Node getVisibleNode(Node node) {
    Node next;
    while (true) {
      next = node.getParentElement();
      if (maybeStrip(node) == false) {
        return node;
      }
View Full Code Here

    ContentNode commonAncestor =
        DocHelper.nearestCommonAncestor(renderedContent, first
            .getContainer(), second.getContainer());

    Node fragment = PASTE_FORMAT_RENDERER.renderTree(renderedContent, commonAncestor,
        selectionMatcher);

    Preconditions.checkNotNull(selectionMatcher.getHtmlStart(), "html start is null, first: " + first);
    Preconditions.checkNotNull(selectionMatcher.getHtmlEnd(), "html end is null second: " + second);

    assert fragment.isOrHasChild(selectionMatcher.getHtmlStart().getContainer()) :
      "SelectionMatcher start not attached";
    assert fragment.isOrHasChild(selectionMatcher.getHtmlEnd().getContainer()) :
      "SelectionMatcher end not attached";


    PointRange<Node> newRange = new PointRange<Node>(
        selectionMatcher.getHtmlStart(),
View Full Code Here

      return;
    }

    previousContentRange = contentRange;

    Node n = event.getTarget();
    if (n.getNodeType() == Node.ELEMENT_NODE) {
      Element e = Element.as(event.getTarget());
      if (DOM_EVENTS_IGNORE.contains(event.getType())) {
        // ignore
        return;
      } else if (event.getType().equals("DOMNodeInserted") && handleDOMNodeInserted(e)) {
View Full Code Here

   * @param event a dom mutation event
   */
  public void handleMutationEvent(SignalEvent event) {
    // TODO(user): Do we care about other types of events?
    if (event.getType().equals("DOMNodeRemoved")) {
      Node target = event.getTarget();
      boolean ignorableWhenEmpty = DomHelper.isTextNode(target)
          || !NodeManager.hasBackReference(target.<Element>cast());
      if (ignorableWhenEmpty && entries.isEmpty()) {
        // If it's a text node, or a non-backreferenced element,
        // and we don't already have entries, then we just ignore it as regular typing. Ok.
      } else {

        EditorStaticDeps.logger.trace().log("REVERT REMOVAL: " + (DomHelper.isTextNode(target)
            ? target.<Text>cast().getData() : target.<Element>cast().getTagName()));

        addEntry(new RemovalEntry(target, target.getParentElement(), target.getNextSibling(),
            ignorableWhenEmpty));
      }
    }
  }
View Full Code Here

  public static String formatImplDomString(Editor editor) {
    if (EditorTestingUtil.isConsistent(editor)) {
      // Get editor, null selection if outside the editor:
      PointRange<Node> selection = NativeSelectionUtil.getOrdered();
      if (selection != null) {
        Node editorHtml = editor.getWidget().getElement();
        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;
View Full Code Here

          nodelet.deleteData(subOffset, count);
          getExtendedContext().editing().textNodeletAffected(
              nodelet, subOffset, -count, TextNodeChangeType.DATA);
        } 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

TOP

Related Classes of com.google.gwt.dom.client.Node

Copyright © 2018 www.massapicom. 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.