void (@NotNull RadComponent component, @Nullable RadComponent insertBefore) { component.setParent(this); int index; List<RadComponent> children = getChildren(); if (insertBefore == null) { index = children.size(); children.add(component); } else { index = children.indexOf(insertBefore); children.add(index, component); } if (myLayout != null) { myLayout.addComponentToContainer(component, index); } }