elemental2.dom.Node.removeChild()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中elemental2.dom.Node.removeChild()方法的一些代码示例,展示了Node.removeChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.removeChild()方法的具体详情如下:
包路径:elemental2.dom.Node
类名称:Node
方法名:removeChild

Node.removeChild介绍

暂无

代码示例

代码示例来源:origin: org.jboss.errai/errai-common

  1. /**
  2. * Detaches all element children from a node.
  3. * @param node Must not be null.
  4. * @return True iff any element children were detached by this call.
  5. */
  6. public boolean removeAllElementChildren(final Node node) {
  7. final boolean hadChildren = node.lastChild != null;
  8. while (node.lastChild != null) {
  9. node.removeChild(node.lastChild);
  10. }
  11. return hadChildren;
  12. }

代码示例来源:origin: errai/errai

  1. /**
  2. * Detaches all element children from a node.
  3. * @param node Must not be null.
  4. * @return True iff any element children were detached by this call.
  5. */
  6. public boolean removeAllElementChildren(final Node node) {
  7. final boolean hadChildren = node.lastChild != null;
  8. while (node.lastChild != null) {
  9. node.removeChild(node.lastChild);
  10. }
  11. return hadChildren;
  12. }

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

  1. public static void remove(final Node element) {
  2. element.parentNode.removeChild(element);
  3. }
  4. }

代码示例来源:origin: kiegroup/appformer

  1. public static void remove(final Node element) {
  2. element.parentNode.removeChild(element);
  3. }
  4. }

代码示例来源:origin: hal/elemento

  1. @Override
  2. public void remove() {
  3. if (last == null) {
  4. throw new IllegalStateException();
  5. }
  6. parent.removeChild(last);
  7. last = null;
  8. }
  9. }

代码示例来源:origin: hal/elemento

  1. /**
  2. * Removes the child from parent if both parent and child are not null and parent contains child.
  3. *
  4. * @return {@code true} if the the element has been removed from its parent, {@code false} otherwise.
  5. */
  6. public static boolean failSafeRemove(Node parent, Element child) {
  7. //noinspection SimplifiableIfStatement
  8. if (parent != null && child != null && parent.contains(child)) {
  9. return parent.removeChild(child) != null;
  10. }
  11. return false;
  12. }

代码示例来源:origin: kiegroup/appformer

  1. @Test
  2. public void testRemove() {
  3. final Node node = mock(Node.class);
  4. final Node parentNode = mock(Node.class);
  5. node.parentNode = parentNode;
  6. ElementHelper.remove(node);
  7. verify(parentNode).removeChild(node);
  8. }
  9. }

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

  1. @Test
  2. public void testRemove() {
  3. final Node node = mock(Node.class);
  4. final Node parentNode = mock(Node.class);
  5. node.parentNode = parentNode;
  6. ElementHelper.remove(node);
  7. verify(parentNode).removeChild(node);
  8. }
  9. }

相关文章