protected function displayMessage(
        $message_id,
        SwatMessage $message,
        $first = false,
        $last = false
    ) {
        $message_div = new SwatHtmlTag('div');
        $container_div = new SwatHtmlTag('div');

        $message_div->id = $this->id . '_' . $message_id;
        $message_div->class = $message->getCSSClassString();

        if ($first) {
            $message_div->class .= ' swat-message-first';
        }

        if ($last) {
            $message_div->class .= ' swat-message-last';
        }

        $message_div->open();

        $container_div->class = 'swat-message-container';
        $container_div->open();

        $primary_content = new SwatHtmlTag('h3');
        $primary_content->class = 'swat-message-primary-content';
        $primary_content->setContent(
            $message->primary_content,
            $message->content_type
        );

        $primary_content->display();

        if ($message->secondary_content !== null) {
            $secondary_div = new SwatHtmlTag('div');
            $secondary_div->class = 'swat-message-secondary-content';
            $secondary_div->setContent(
                $message->secondary_content,
                $message->content_type
            );

            $secondary_div->display();
        }

        $container_div->close();
        $message_div->close();
    }