                 IFlexDisplayObject(decoratorDisplay).move(unscaledWidth - 10 - decoratorWidth, (unscaledHeight - decoratorHeight)/2);
             }
         }
+
+        // FIXME (rfrishbe): update for subText and header and use padding and gaps
         
         // text should take up the rest of the space
         var labelWidth:Number = unscaledWidth - iconWidth - decoratorWidth;
-        labelWidth -= 20; // padding of 10 always on left and right
+        labelWidth -= (getStyle("paddingLeft") + getStyle("paddingRight"));
         
         // don't forget the extra padding of 5 if these elements exist
         if (iconDisplay)
-            labelWidth -= 5;
+            labelWidth -= getStyle("horizontalGap");
         if (decoratorDisplay)
-            labelWidth -= 5;
+            labelWidth -= getStyle("horizontalGap");
         
         // padding of 5 from the left
-        var labelX:Number = 10;
+        var labelX:Number = getStyle("paddingLeft");
         if (iconDisplay)
-            labelX += iconWidth + 5;
+            labelX += iconWidth + getStyle("horizontalGap");
         
         labelTextField.width = labelWidth;
-        labelTextField.height = labelTextField.textHeight + 4;
+        labelTextField.height = labelTextField.textHeight + 4; // 4 is text field padding
         
         labelTextField.x = labelX;
         labelTextField.y = (unscaledHeight - labelTextField.height)/2;
     }
     
-    /**
-     *  @private
-     */
-    override public function styleChanged(styleName:String):void
-    {
-        var allStyles:Boolean = !styleName || styleName == "styleName";
-        
-        super.styleChanged(styleName);
-        
-        if (allStyles || styleName == "inputMode")
-        {
-            addHandlers();
-        }
-        
-        if (allStyles || styleName in TEXT_CSS_STYLES)
-        {
-            recreateLabelTextFieldStyles = true;
-            invalidateProperties();
-        }
-    }
-    
-    //--------------------------------------------------------------------------
-    //
-    //  Event handling
-    //
-    //--------------------------------------------------------------------------
-    
-    /**
-     *  @private
-     *  Keeps track of whether rollover/rollout events were added
-     * 
-     *  We need to be careful about calling add/remove event listener because 
-     *  of the reference counting going on in 
-     *  super.addEventListener/removeEventListener.
-     */
-    private var rolloverEventsAdded:Boolean = false;
-    
-    /**
-     *  @private
-     *  Attach the mouse events.
-     */
-    private function addHandlers():void
-    {
-        if (getStyle("inputMode") == "mouse")
-        {
-            if (!rolloverEventsAdded)
-            {
-                rolloverEventsAdded = true;
-                addEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                addEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-        else
-        {
-            if (rolloverEventsAdded)
-            {
-                rolloverEventsAdded = false;
-                removeEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                removeEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-    }
-    
-    /**
-     *  @private
-     */
-    private function anyButtonDown(event:MouseEvent):Boolean
-    {
-        var type:String = event.type;
-        return event.buttonDown || (type == "middleMouseDown") || (type == "rightMouseDown"); 
-    }
-    
-    /**
-     *  @private
-     *  Mouse rollOver event handler.
-     */
-    protected function itemRenderer_rollOverHandler(event:MouseEvent):void
-    {
-        if (!anyButtonDown(event))
-        {
-            hovered = true;
-            invalidateDisplayList();
-        }
-    }
-    
-    /**
-     *  @private
-     *  Mouse rollOut event handler.
-     */
-    protected function itemRenderer_rollOutHandler(event:MouseEvent):void
-    {
-        hovered = false;
-        invalidateDisplayList();
-    }
-    
 }
     
 }
use namespace mx_internal;

//--------------------------------------
//  Events
//--------------------------------------

/**
 *  Dispatched when the <code>data</code> property changes.
 *
 *  <p>When you use a component as an item renderer,
 *  the <code>data</code> property contains the data to display.
 *  You can listen for this event and update the component
 *  when the <code>data</code> property changes.</p>
 * 
 *  @eventType mx.events.FlexEvent.DATA_CHANGE
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Event(name="dataChange", type="mx.events.FlexEvent")]

//--------------------------------------
//  Styles
//--------------------------------------

// FIXME(rfrishbe): get these styles somehow
//include "../../styles/metadata/BasicInheritingTextStyles.as"
//include "../../styles/metadata/AdvancedInheritingTextStyles.as"
//include "../../styles/metadata/SelectionFormatTextStyles.as"

/**
 *  The colors to use for the backgrounds of the items in the list. 
 *  The value is an array of two or more colors. 
 *  The backgrounds of the list items alternate among the colors in the array. 
 * 
 *  @default undefined
 * 
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]

/**
 *  Color of focus ring when the component is in focus
 *   
 *  @default 0x70B2EE
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */ 
[Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]

/**
 *  Color of the highlights when the mouse is over the component
 *   
 *  @default 0xCEDBEF
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */ 
[Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]
// FIXME (rfrishbe): should be theme="" above

/**
 *  Color of the highlights when the item is selected
 *   
 *  @default 0xCEDBEF
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */ 
[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
// FIXME (rfrishbe): figure out why this isn't on defaultitemrenderer or itemrenderer

/**
 *  Color of any symbol of a component. Examples include the check mark of a CheckBox or
 *  the arrow of a scroll button
 *   
 *  @default 0x000000
 * 
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */ 
[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]

//--------------------------------------
//  Excluded APIs
//--------------------------------------

[Exclude(name="focusBlendMode", kind="style")]
[Exclude(name="focusThickness", kind="style")]

/**
 *  The IconItemRenderer class is a performant item 
 *  renderer optimized for mobile devices.  It contains 
 *  an optional icon on the left, text in the middle, and 
 *  an optional decorator icon on the right.
 *
 *  <p>You can override the default item renderer
 *  by creating a custom item renderer.</p>
 *
 *  @see spark.components.List
 *  @see mx.core.IDataRenderer
 *  @see spark.components.IItemRenderer
 *  @see spark.components.supportClasses.ItemRenderer
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 2.5
 *  @productversion Flex 4.5
 */
public class IconItemRenderer extends UIComponent
    implements IDataRenderer, IItemRenderer
{
    
    // Image cache for all instances of this item renderer.
    static private var _imageCache: ContentCache;
    
    //--------------------------------------------------------------------------
    //

    }
    
    //----------------------------------
    //  subTextField
    //----------------------------------
    
    /**
     *  @private
     */
    private var _subTextField:String;
    
    /**
     *  @private
     */
    private var subTextFieldOrFunctionChanged:Boolean; 
    
    /**
     *  The name of the field in the data provider items to display 
     *  as the subText. 
     *  The <code>subTextFunction</code> property overrides this property.
     *
     *  @default null
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.5
     *  @productversion Flex 4.5
     */
    public function get subTextField():String
    {
        // FIXME (rfrishbe): PARB this property name b/c confusing with "TextField" the component
        return _subTextField;
    }
    
    /**
     *  @private
     */
    public function set subTextField(value:String):void
    {
        if (value == _subTextField)
            return;
        
        _subTextField = value;
        subTextFieldOrFunctionChanged = true;
        invalidateProperties();
    }
    
    //----------------------------------
    //  subTextFunction
    //----------------------------------
    
    /**
     *  @private
     */
    private var _subTextFunction:Function;
    
    /**
     *  A user-supplied function to run on each item to determine its subText.  
     *  The <code>subTextFunction</code> property overrides 
     *  the <code>subTextField</code> property.
     *
     *  <p>You can supply a <code>subTextFunction</code> that finds the 
     *  appropriate fields and returns a displayable string. The 
     *  <code>subTextFunction</code> is also good for handling formatting and 
     *  localization.</p>
     *
     *  <p>The subText function takes a single argument which is the item in 
     *  the data provider and returns a String.</p>
     *  <pre>
     *  mySubTextFunction(item:Object):String</pre>
     *
     *  @default null
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 2.5
     *  @productversion Flex 4.5
     */
    public function get subTextFunction():Function
    {
        return _subTextFunction;
    }
    
    /**
     *  @private
     */
    public function set subTextFunction(value:Function):void
    {
        if (value == _subTextFunction)
            return;
        
        _subTextFunction = value;
        subTextFieldOrFunctionChanged = true;
        invalidateProperties(); 
    }
    
    //--------------------------------------------------------------------------
