本文整理了Java中elemental2.dom.Node.removeChild()
方法的一些代码示例,展示了Node.removeChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.removeChild()
方法的具体详情如下:
包路径:elemental2.dom.Node
类名称:Node
方法名:removeChild
暂无
代码示例来源:origin: org.jboss.errai/errai-common
/**
* Detaches all element children from a node.
* @param node Must not be null.
* @return True iff any element children were detached by this call.
*/
public boolean removeAllElementChildren(final Node node) {
final boolean hadChildren = node.lastChild != null;
while (node.lastChild != null) {
node.removeChild(node.lastChild);
}
return hadChildren;
}
代码示例来源:origin: errai/errai
/**
* Detaches all element children from a node.
* @param node Must not be null.
* @return True iff any element children were detached by this call.
*/
public boolean removeAllElementChildren(final Node node) {
final boolean hadChildren = node.lastChild != null;
while (node.lastChild != null) {
node.removeChild(node.lastChild);
}
return hadChildren;
}
代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly
public static void remove(final Node element) {
element.parentNode.removeChild(element);
}
}
代码示例来源:origin: kiegroup/appformer
public static void remove(final Node element) {
element.parentNode.removeChild(element);
}
}
代码示例来源:origin: hal/elemento
@Override
public void remove() {
if (last == null) {
throw new IllegalStateException();
}
parent.removeChild(last);
last = null;
}
}
代码示例来源:origin: hal/elemento
/**
* Removes the child from parent if both parent and child are not null and parent contains child.
*
* @return {@code true} if the the element has been removed from its parent, {@code false} otherwise.
*/
public static boolean failSafeRemove(Node parent, Element child) {
//noinspection SimplifiableIfStatement
if (parent != null && child != null && parent.contains(child)) {
return parent.removeChild(child) != null;
}
return false;
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testRemove() {
final Node node = mock(Node.class);
final Node parentNode = mock(Node.class);
node.parentNode = parentNode;
ElementHelper.remove(node);
verify(parentNode).removeChild(node);
}
}
代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly
@Test
public void testRemove() {
final Node node = mock(Node.class);
final Node parentNode = mock(Node.class);
node.parentNode = parentNode;
ElementHelper.remove(node);
verify(parentNode).removeChild(node);
}
}
内容来源于网络,如有侵权,请联系作者删除!