public function onContextPaneInit(ContextPaneEvent $event)
    {
        $site = null;
        $contextPane = $event->getContextPane();

        if ($this->siteManager->hasContext()) {
            $site = $this->siteManager->getContext();
        }

        // Add admin actions on the tree listing page
        if ('admin/dashboard/tree' === current_path()) {
            $canCreate = false;
            if ($site) {
                $canCreate = $this->menuAccess->canCreateMenu($this->currentUser, $site);
            } else {
                $canCreate = $this->menuAccess->canCreateMenu($this->currentUser);
            }
            if ($canCreate) {
                $contextPane->addActions([
                    new Action($this->t("Create menu"), 'admin/dashboard/tree/add', [], 'plus', 0, true, true),
                ]);
            }
        }

        if ($site) {
            // Add the tree structure as a new tab
            $contextPane
                ->addTab('tree', $this->t("Menu tree"), 'bars')
                ->add($this->renderCurrentTree(), 'tree')
            ;

            if (preg_match('@^admin/dashboard/tree/(\d+)$@', current_path())) {
                // Default tab on tree edit is the cart
                $contextPane->setDefaultTab('cart');
            } elseif (!$contextPane->getRealDefaultTab()) {
                // Else it's the tree
                $contextPane->setDefaultTab('tree');
            }
        }
    }