private function attachToParent(SwatUIObject $object, SwatUIParent $parent)
    {
        if ($parent instanceof SwatUIParent) {
            $parent->addChild($object);
        } else {
            $class_name = get_class($parent);
            throw new SwatDoesNotImplementException(
                "Can not add object to parent. '{$class_name}' does not " .
                    'implement SwatUIParent.',
                0,
                $parent
            );
        }
    }