protected function populatePanel(EnvironmentInterface $environment)
    {
        /** @var BackendViewInterface $view */
        $view = $environment->getView();

        // Already populated or not in Backend? Get out then.
        if (!(($view instanceof BaseView))) {
            return;
        }

        if (!$environment->getDataDefinition()->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) {
            return;
        }

        // Already populated.
        if ($view->getPanel()) {
            return;
        }

        $view->setPanel((new PanelBuilder($environment))->build());
    }