@Override public void remove() { checkModCount(); Assert.state(fetched, "No element to remove"); fetched = false; ChildList.this.remove(--next); expected = modCount; }
protected void remove(BaseComponent child, boolean noSync, boolean destroy) { if (child instanceof IComposite) { BaseComponent root = ((IComposite) child).getCompositeRoot(); BaseComponent parent = root == null ? null : root.getParent(); if (parent != null) { parent.children.remove(root, noSync, destroy); } child.parent = null; modCount++; } else { int index = indexOf(child); ComponentException.assertTrue(index != -1, parent, "Child does not belong to this parent"); parent.beforeRemoveChild(child); parent.nameIndex.remove(child); child.parent = null; delegate.remove(child); modCount++; if (!noSync) { parent.invokeIfAttached("removeChild", child, destroy); } child.dead |= destroy; parent.afterRemoveChild(child); } }
oldParent.children.remove(child, true, false);
/** * Destroys this component. */ public void destroy() { if (dead) { return; } onDestroy(); if (page != null) { page.registerComponent(this, false); } destroyChildren(); if (parent != null) { parent.children.remove(this, false, true); } else { invokeIfAttached("destroy"); } dead = true; fireEvent(new Event("destroy", this)); eventListeners.removeAll(); }
public void clear(boolean destroy) { while (!isEmpty()) { remove(get(0), false, destroy); } }
@Override public boolean remove(Object o) { remove((BaseComponent) o, false, false); return true; }
/** * Removes a child from this parent. * * @param child Child to remove. */ public void removeChild(BaseComponent child) { children.remove(child); }
@Override public boolean removeAll(Collection<?> c) { for (Object child : c) { remove(child); } return true; }
@Override public BaseComponent remove(int index) { BaseComponent old = get(index); remove(old); return old; }