void (final ArrayList<? super RadComponent> result, final RadContainer container) { if (container.isSelected()) { if (container.getParent() != null) { // ignore RadRootContainer result.add(container); return; } } for (int i = 0; i < container.getComponentCount(); i++) { final RadComponent component = container.getComponent(i); if (component instanceof RadContainer) { calcSelectedComponentsImpl(result, (RadContainer)component); } else { if (component.isSelected()) { result.add(component); } } } }