IRootContainer (IComponent component) { while (component != null) { if (component.getParentContainer() instanceof IRootContainer) { return (IRootContainer)component.getParentContainer(); } component = component.getParentContainer(); } return null; }