protected static function createNewGroup(&$root, $button, &$dropdown, $addToRoot = true)
    {
        if ($addToRoot) {
            $root = self::enableToolbar($root);
        }

        if ($dropdown !== false) {
            $dropdown = false;
        }

        $group = static::createGroup($button['attributes'], true, ($button['type'] === 'vgroup'));

        if ($addToRoot) {
            $root->addChild($group);
        } else {
            $root = $group;
        }

        return $group;
    }