 package spark.components
 {
 
+import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 
 import spark.components.supportClasses.TextBase;
-import spark.utils.LabelUtil;    
+import spark.utils.LabelUtil;
     
 use namespace mx_internal;
 

        labelChanged = true;
        invalidateProperties();
    }

    
    //--------------------------------------------------------------------------
    //

    
    /**
     *  @private
     */
    override protected function measure():void
    {
        // If typicalItem is set, then use it for measurement
        if (labelDisplay && typicalItem != null)
        {   
            // Save the labelDisplay's dimensions in case we clear out typicalItem
            if (!sizeSetByTypicalItem)
            {
                labelDisplayExplicitWidth = labelDisplay.explicitWidth;
                labelDisplayExplicitHeight = labelDisplay.explicitHeight;
                sizeSetByTypicalItem = true;
            }
            
            labelDisplay.explicitWidth = NaN;
            labelDisplay.explicitHeight = NaN;
            
            // Swap in the typicalItem into the labelDisplay
            updateLabelDisplay(typicalItem);
            UIComponentGlobals.layoutManager.validateClient(skin, true);
            
            // Force the labelDisplay to be sized to the measured size
            labelDisplay.width = labelDisplay.measuredWidth;
            labelDisplay.height = labelDisplay.measuredHeight;
            
            // Set the labelDisplay back to selectedItem
            updateLabelDisplay();
        }
        else if (sizeSetByTypicalItem && typicalItem == null)
        {
            // Restore the labelDisplay to its original size
            labelDisplay.width = labelDisplayExplicitWidth;
            labelDisplay.height = labelDisplayExplicitHeight;
            sizeSetByTypicalItem = false;
        }
        
        super.measure();
    }
    
    /**
     *  @private
     *  Called whenever we need to update the text passed to the labelDisplay skin part
     */
    // TODO (jszeto): Make this protected and make the name more generic (passing data to skin) 
    override mx_internal function updateLabelDisplay(displayItem:* = undefined):void
    {
        if (labelDisplay)
        {
            if (displayItem == undefined)
                displayItem = selectedItem;
            if (displayItem != null && displayItem != undefined)
                labelDisplay.text = LabelUtil.itemToLabel(displayItem, labelField, labelFunction);
            else
                labelDisplay.text = prompt;
        }   
