public function getWidget($row_identifier, $widget_id = null)
    {
        $this->getClonedWidget($row_identifier);

        if ($widget_id === null && isset($this->clones[$row_identifier])) {
            return $this->clones[$row_identifier];
        } elseif (
            $widget_id !== null &&
            isset($this->widgets[$row_identifier][$widget_id])
        ) {
            return $this->widgets[$row_identifier][$widget_id];
        }

        throw new SwatException(
            'The specified widget was not found with the ' .
                'specified row identifier.'
        );
    }