protected function getCSSClassNames()
    {
        $classes = array('swat-button');

        $form = $this->getFirstAncestor('SwatForm');
        $primary =
            $form !== null && $form->getFirstDescendant('SwatButton') === $this;

        if ($primary) {
            $classes[] = 'swat-primary';
        }

        if ($this->stock_class !== null) {
            $classes[] = $this->stock_class;
        }

        $classes = array_merge($classes, parent::getCSSClassNames());

        return $classes;
    }