/** * Returns a flattened array of all children of this container. Note that this * method will trigger the creation of a cached internal array on its first * use, which cannot be recreated. It is essential therefore that it only be * used once ALL modifications to the component tree have concluded (i.e. once * rendering starts). */ public UIComponent[] flatChildren() { if (flatchildren == null) { ComponentList children = flattenChildren(); flatchildren = (UIComponent[]) children.toArray(new UIComponent[children .size()]); } return flatchildren; }
private void registerContainer(UIForm toprocess, UIContainer toregister) { ComponentList children = toregister.flattenChildren(); for (int i = 0; i < children.size(); ++i) { UIComponent child = children.componentAt(i); registerComponent(toprocess, child); } } }
private ComponentIterator iteriseComponent(UIComponent parent) { if (parent instanceof UIContainer) { return ((UIContainer) parent).flattenChildren().iterate(); } else { ConcreteChildIterator cci = new ConcreteChildIterator(parent, smc); return new ComponentList(cci.children()).iterate(); } }
private void cloneChildren(UIContainer target, UIContainer source, RemapState state) { ComponentList children = source.flattenChildren(); for (int i = 0; i < children.size(); ++i) { UIComponent child = (UIComponent) children.get(i); if (child instanceof UIReplicator) { expandReplicator(target, (UIReplicator) child, state); } else { UIComponent cloned = cloneComponent(child, state); target.addComponent(cloned); } } }
private void appendContainer(UIContainer toappend) { ComponentList thischildren = toappend.flattenChildren();