             messageHeight = Math.max(viewHeight - labelHeight - verticalGap, 0);
             
             messageDisplay.width = messageWidth;
+            // FIXME (rfrishbe): we should check to see if this causes textHeight to change because then we 
+            // might need to remeasure
             messageDisplay.height = messageHeight;
             
             // FIXME (rfrishbe): figure out if this is right with regards to multi-line text.

        return styleValue;
    }
    
    /**
     *  @private 
     *  Function to help figure out the sizes of the header and message.  We cannot use 
     *  UIComponent.measureText() because we are adding a few additional styles 
     *  to it based on headerStyleName and messageStyleName.
     */
    private function measureMessageText(text:String):TextLineMetrics
    {
        // Copied from UIComponent.measureText()
        cachedMessageTextFormat = determineTextFormatWithGetStyleFunction(messageGetStyleFunction, cachedMessageTextFormat);
        return cachedMessageTextFormat.measureText(text);
    }
    
    /**
     *  @private 
     *  Function to help figure out the sizes of the header and message.  We cannot use 
     *  UIComponent.measureText() because we are adding a few additional styles 
     *  to it based on headerStyleName and messageStyleName.
     */
    private function determineTextFormatWithGetStyleFunction(getStyleFunction:Function, cachedTextFormat:UITextFormat):UITextFormat
    {
        // copied and adapted from UIComponent.determineTextFormatFromStyles
        var textFormat:UITextFormat = cachedTextFormat;
        
        if (!textFormat)
        {
            var font:String =
                StringUtil.trimArrayElements(getStyleFunction("fontFamily"), ",");
            textFormat = new UITextFormat(getNonNullSystemManager(), font);
            textFormat.moduleFactory = moduleFactory;
            
            // Not all flex4 textAlign values are valid so convert to a valid one.
            var align:String = getStyleFunction("textAlign");
            if (align == "start") 
                align = TextFormatAlign.LEFT;
            else if (align == "end")
                align = TextFormatAlign.RIGHT;
            textFormat.align = align; 
            textFormat.bold = getStyleFunction("fontWeight") == "bold";
            textFormat.color = enabled ?
                getStyleFunction("color") :
                getStyleFunction("disabledColor");
            textFormat.font = font;
            textFormat.indent = getStyleFunction("textIndex");
            textFormat.italic = getStyleFunction("fontStyle") == "italic";
            textFormat.kerning = getStyleFunction("kerning");
            textFormat.leading = getStyleFunction("leading");
            textFormat.leftMargin = getStyleFunction("paddingLeft"); // FIXME (rfrishbe): should these be in here...?
            textFormat.letterSpacing = getStyleFunction("letterSpacing")
            textFormat.rightMargin = getStyleFunction("paddingRight");
            textFormat.size = getStyleFunction("fontSize");
            textFormat.underline =
                getStyleFunction("textDecoration") == "underline";
            
            textFormat.antiAliasType = getStyleFunction("fontAntiAliasType");
            textFormat.gridFitType = getStyleFunction("fontGridFitType");
            textFormat.sharpness = getStyleFunction("fontSharpness");
            textFormat.thickness = getStyleFunction("fontThickness");
            
            //textFormat.useFTE =
            //    getTextFieldClassName() == "mx.core::UIFTETextField" ||
            //    getTextInputClassName() == "mx.controls::MXFTETextInput";
            
            //if (textFormat.useFTE)
            //{
            //    textFormat.direction = getStyleFunction("direction");
            //    textFormat.locale = getStyleFunction("locale");
            //}
            
            cachedTextFormat = textFormat;
        }
        
        return textFormat;
    }
    
}
    
}
import flash.text.TextFieldType;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;

import mx.controls.listClasses.*;
import mx.core.IDataRenderer;
