public function buildContainer(Model\ContainerInterface $container)
    {
        // Rendering source (for copy containers)
        $source = is_null($container->getCopy()) ? $container : $container->getCopy();

        $view = new ContainerView();
        $attributes = $view->getAttributes()->addClass('cms-container');
        $attributes->setId('cms-container-' . $container->getId());

        $innerAttributes = $view->getInnerAttributes()->addClass('cms-inner-container');

        if ($this->editor->isEnabled()) {
            $content = $container->getContent();

            // Container
            $attributes
                ->setData([
                    'id'       => $container->getId(),
                    'position' => $container->getPosition(),
                    'type'     => $container->getType(),
                    'actions'  => [
                        'add'         => !is_null($content),
                        'edit'        => true,
                        'layout'      => is_null($container->getCopy()),
                        'change_type' => !$container->isNamed() && !$container->isTitled(),
                        'move_up'     => !$container->isFirst(),
                        'move_down'   => !$container->isLast(),
                        'remove'      => !$container->isAlone(),
                    ],
                ]);

            // Inner container
            $innerAttributes
                ->setId('cms-inner-container-' . $source->getId())
                ->setData([
                    'id' => $source->getId(),
                ]);
        }

        // Layout
        $this->editor->getLayoutAdapter()->buildContainer($source, $view);
        $view->content = '<span class="cms-container-anchor">&nbsp;</span>' . $view->content;


        // Plugin
        $this->editor->getContainerPlugin($source->getType())->render($source, $view);

        // Don't build rows if the plugin did generate a content
        if (0 == strlen($view->innerContent)) {
            foreach ($source->getRows() as $row) {
                $view->rows[] = $this->buildRow($row);
            }
        }

        return $view;
    }