protected function buttonsViewData(FormRuleContext $context)
    {
        $buttonNames = $context->getButtons();

        $buttons = array();
        foreach ($buttonNames as $name) {
            $groups = $context->getGroup($name);

            $buttons[] = array(
                'name' => $name,
                'cancel' => count($groups) === 0,
                'validation_groups' => $groups,
            );
        }

        return $buttons;
    }