public function setFromStock($stock_id, $overwrite_properties = true)
    {
        $content_type = 'text/plain';

        switch ($stock_id) {
            case 'yes-no':
                $false_content = Swat::_('No');
                $true_content = Swat::_('Yes');
                break;

            case 'check-only':
                $content_type = 'text/xml';
                $false_content = ' '; // non-breaking space

                ob_start();
                $this->displayCheck();
                $true_content = ob_get_clean();
                break;

            default:
                throw new SwatUndefinedStockTypeException(
                    "Stock type with id of '{$stock_id}' not found.",
                    0,
                    $stock_id
                );
        }

        if ($overwrite_properties || $this->false_content === null) {
            $this->false_content = $false_content;
        }

        if ($overwrite_properties || $this->true_content === null) {
            $this->true_content = $true_content;
        }

        if ($overwrite_properties || $this->content_type === null) {
            $this->content_type = $content_type;
        }
    }