private final Component children_remove(Component component) { int index = children_indexOf(component); if (index != -1) { return children_remove(index); } return null; }
/** * * @param component * @return The component that is removed. */ private final Component children_remove(Component component) { int index = children_indexOf(component); if (index != -1) { return children_remove(index); } return null; }
/** * @param component * Component to remove from this container */ public void remove(final Component component) { checkHierarchyChange(component); if (component == null) { throw new IllegalArgumentException("argument component may not be null"); } children_remove(component); removedComponent(component); }
/** * @param component * Component to remove from this container */ public void remove(final Component component) { checkHierarchyChange(component); if (component == null) { throw new IllegalArgumentException("argument component may not be null"); } children_remove(component); removedComponent(component); }
/** * Removes a component from the children identified by the {@code component.getId()} * * @param component * Component to remove from this container * @return {@code this} for chaining */ public MarkupContainer remove(final Component component) { checkHierarchyChange(component); Args.notNull(component, "component"); children_remove(component.getId()); removedComponent(component); return this; }
/** * Removes a component from the children identified by the {@code component.getId()} * * @param component * Component to remove from this container * @return {@code this} for chaining */ public MarkupContainer remove(final Component component) { checkHierarchyChange(component); Args.notNull(component, "component"); children_remove(component.getId()); removedComponent(component); return this; }
if (index >= 0) children_remove(index);
void detachChildren() { super.detachChildren(); for (int i = children_size(); i-- > 0;) { Object child = children_get(i, false); if (child instanceof Component) { Component component = (Component)child; component.detach(); if (child instanceof IComponentSourceProvider) { ComponentSourceEntry entry = new ComponentSourceEntry(this, component, ((IComponentSourceProvider)child).getComponentSource()); children_set(i, entry, false); } else if (component.isAuto()) { children_remove(i); } } } if (children instanceof ChildList) { ChildList lst = (ChildList)children; Object[] tmp = new Object[lst.size]; System.arraycopy(lst.childs, 0, tmp, 0, lst.size); children = tmp; } }
if (index >= 0) children_remove(index);
children_remove(component.getId()); add(component);
children_remove(component.getId()); add(component);