public function hasWidget($nameOrWidget)
    {
        $name = $nameOrWidget instanceof WidgetInterface ? $nameOrWidget->getName() : $nameOrWidget;

        return array_key_exists($name, $this->widgets);
    }