Renders an alert in its container.

@param parent Parent component that will host the container.
@param child Child component that is the root component of the alert.
@return The created container.
348526
public static AlertContainer render(BaseComponent parent, BaseComponent child) {
        AlertContainer container = new AlertContainer(child);
        parent.addChild(container, 0);
        return container;
    }
936394
public Element createDOMNode(Element parent) {
        Element domNode = parent.getOwnerDocument().createElement(tagName);
        LayoutUtil.copyAttributes(attributes, domNode);
        parent.appendChild(domNode);
        return domNode;
    }
678447
public static NodeImpl createBeanNode(final NodeImpl parent) {
    return new NodeImpl( //
        null, //
        parent, //
        false, //
        null, //
        null, //
        ElementKind.BEAN, EMPTY_CLASS_ARRAY, //
        null, //
        null, //
        null, //
        null //
    );
  }
112946
public void addChild(Config child)
  {
    Params.notNull(child, "Child");
    child.parent = this;
    children.add(child);
  }
88810
public ResponseBuilder initialize(final Resource parent, final Resource child) {
        if (MISSING_RESOURCE.equals(parent)) {
            // Can't POST to a missing resource
            throw new NotFoundException();
        } else if (DELETED_RESOURCE.equals(parent)) {
            // Can't POST to a deleted resource
            throw new ClientErrorException(GONE);
        } else if (ACL.equals(getRequest().getExt())
                || ldpResourceTypes(parent.getInteractionModel()).noneMatch(LDP.Container::equals)) {
            // Can't POST to an ACL resource or non-Container
            throw new NotAllowedException(GET, Stream.of(HEAD, OPTIONS, PATCH, PUT, DELETE).toArray(String[]::new));
        } else if (!MISSING_RESOURCE.equals(child) && !DELETED_RESOURCE.equals(child)) {
            throw new ClientErrorException(CONFLICT);
        } else if (!supportsInteractionModel(ldpType)) {
            throw new BadRequestException("Unsupported interaction model provided", status(BAD_REQUEST)
                .link(UnsupportedInteractionModel.getIRIString(), LDP.constrainedBy.getIRIString()).build());
        } else if (ldpType.equals(LDP.NonRDFSource) && rdfSyntax != null) {
            LOGGER.error("Cannot save {} as a NonRDFSource with RDF syntax", getIdentifier());
            throw new BadRequestException("Cannot save resource as a NonRDFSource with RDF syntax");
        }

        setParent(parent);
        return status(CREATED);
    }
88861
private static IIOMetadataNode getOrCreateChildNode(IIOMetadataNode parentNode, String name)
    {
        NodeList nodeList = parentNode.getElementsByTagName(name);
        if (nodeList.getLength() > 0)
        {
            return (IIOMetadataNode) nodeList.item(0);
        }
        IIOMetadataNode childNode = new IIOMetadataNode(name);
        parentNode.appendChild(childNode);
        return childNode;
    }
1121935
private void createSubMenu(
        CmsContextMenuItemWidget parentWidget,
        ContextMenuItemState childState,
        CmsContextMenuConnector connector) {

        CmsContextMenuItemWidget childWidget = createEmptyItemWidget(
            childState.getId(),
            childState.getCaption(),
            childState.getDescription(),
            connector);
        childWidget.setEnabled(childState.isEnabled());
        childWidget.setSeparatorVisible(childState.isSeparator());
        setStyleNames(childWidget, childState.getStyles());
        parentWidget.addSubMenuItem(childWidget);

        for (ContextMenuItemState child : childState.getChildren()) {
            createSubMenu(childWidget, child, connector);
        }
    }
361609
protected static void appendHandler(Class<? extends LogRecordHandler> parent, LogRecordHandler child){
    List<LogRecordHandler> toAdd = new LinkedList<LogRecordHandler>();
    //--Find Parents
    for(LogRecordHandler term : handlers){
      if(parent.isAssignableFrom(term.getClass())){
        toAdd.add(term);
      }
    }
    //--Add Handler
    for(LogRecordHandler p : toAdd){
      appendHandler(p, child);
    }
  }
642031
public static Component getDescendantNamed(String name, Component parent) {

        Assert.notNull(name, "name");
        Assert.notNull(parent, "parent");

        if (name.equals(parent.getName())) { // Base case
            return parent;
        } else if (parent instanceof Container) { // Recursive case
            for (final Component component : ((Container) parent).getComponents()) {

                final Component foundComponent = SwingUtils.getDescendantNamed(name, component);

                if (foundComponent != null) {
                    return foundComponent;
                }
            }
        }

        return null;
    }
241523
public final int addChild (Task<E> child) {
		int index = addChildToTask(child);
		if (tree != null && tree.listeners != null) tree.notifyChildAdded(this, index);
		return index;
	}
1014590
public static <T extends MutableTreeNode<T>> void removeChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        int index = parent.getChildren().indexOf(child);
        checkElementIndex(index, parent.getChildren().size());
        parent.removeChild(index);
    }
198766
@Override
	public void layoutContainer(Container parent) {
		synchronized (parent.getTreeLock()) {
			Insets insets=parent.getInsets();
			int ncomponents=parent.getComponentCount();
			if(ncomponents==0) return;

			int nrows=rows;
			int ncols=columns;
			if(nrows>0) {
				ncols=((ncomponents/2)+nrows-1)/nrows;
			} else {
				nrows=((ncomponents/2)+ncols-1)/ncols;
			}

			// Determine the desired widths for the labels
			int[] labelWidths=new int[ncols];
			int pos=0;
		Loop1:
			for(int y=0;y<nrows;y++) {
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop1;
					Component component=parent.getComponent(pos);
					pos+=2;
					Dimension d=component.getPreferredSize();
					if(d.width>labelWidths[x]) labelWidths[x]=d.width;
				}
			}
			Dimension parentSize=parent.getSize();
			int width=parentSize.width-(insets.left+insets.right);
			int height=parentSize.height-(insets.top+insets.bottom);
			int lasty=0;
			pos=0;
		Loop:
			for(int y=0;y<nrows;y++) {
				int yend=0;
				int cellHeight=0;
				if (stretchComponents) {
					yend=((y+1)*(height+vgap))/nrows-vgap;
					cellHeight=yend-lasty;
				}
				int lastx=0;
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop;
					int xend=((x+1)*(width+hgap))/ncols-hgap;
					int cellWidth=xend-lastx;
					// Split this width into two areas, left for label and right for component
					int availableWidth=labelWidths[x];
					if(availableWidth>cellWidth) availableWidth=cellWidth;
					// Reshape the label to fit
					Component label=parent.getComponent(pos++);
					Dimension labelD=label.getPreferredSize();
					Component component=parent.getComponent(pos++);
					Dimension componentD=component.getPreferredSize();
					if (!stretchComponents) {
						cellHeight = Math.max(labelD.height, componentD.height);
						if((lasty+cellHeight)>yend) yend=lasty+cellHeight;
						// yend = lasty+cellHeight;
					}

					//int actualWidth=labelD.width;
					//if(actualWidth>availableWidth) actualWidth=availableWidth;
					label.setBounds(
						lastx+insets.left,
						lasty+insets.top,
						availableWidth,
						cellHeight
					);
					// Split out the right area
					if(pos>ncomponents) break Loop;
					availableWidth=cellWidth-cgap-labelWidths[x];
					if(availableWidth<0) availableWidth=0;
					// Reshape the component
					int actualWidth=componentD.width;
					if(actualWidth>availableWidth) actualWidth=availableWidth;
					component.setBounds(
						lastx+labelWidths[x]+cgap+insets.left,
						lasty+insets.top,
						actualWidth,
						cellHeight /*Klay--8/22/01*/
					);
					// Get ready for next iteration
					lastx=xend+hgap;
				}
				lasty=yend+vgap;
			}
		}
	}
962703
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        parent.addChild(parent.getChildren().size(), child);
    }
650254
public static void appendElement(Element parent, Element child) {
        Node tmp = parent.getOwnerDocument().importNode(child, true);
        parent.appendChild(tmp);
    }
1372862
public static Map getOrCreateChildMap(Map parent, String key) {
        Object o = parent.get(key);
        if(o instanceof Map) {
            return (Map)o;
        }
        return new LinkedHashMap();
    }
1363408
public void bringToFront(Object parent, String name) {
		Element parentElement = getGroup(parent);
		if (parentElement == null) {
			throw new IllegalArgumentException("bringToFront failed: could not find parent group.");
		}

		Element element = getElement(parent, name);
		if (element == null) {
			throw new IllegalArgumentException("bringToFront failed: could not find element within group.");
		}
		if (parentElement.getLastChild() != element) {
			parentElement.appendChild(element);
		}
	}
880480
public static void renderChild(FacesContext fc, UIComponent child) throws IOException {
		if (!child.isRendered()) {
			return;
		}

		child.encodeBegin(fc);

		if (child.getRendersChildren()) {
			child.encodeChildren(fc);
		} else {
			renderChildren(fc, child);
		}
		child.encodeEnd(fc);
	}