     {
         if (label != null)
         {
-        	removeChild(DisplayObject(label));
-        	label = null;
-        }
-    }
-
-	//--------------------------------------------------------------------------
-	//
-	//  Event handlers
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private function toolTipShowHandler(event:ToolTipEvent):void
-	{
-		var toolTip:IToolTip = event.toolTip;
-
-		// Calculate global position of label.
+            removeChild(DisplayObject(label));
+            label = null;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function toolTipShowHandler(event:ToolTipEvent):void
+    {
+        var toolTip:IToolTip = event.toolTip;
+
+        // Calculate global position of label.
         var sm:ISystemManager = systemManager.topLevelSystemManager;
         var sbRoot:DisplayObject = sm.getSandboxRoot();
         var screen:Rectangle = sm.getVisibleApplicationRect();
-		var pt:Point = new Point(0, 0);
-		pt = label.localToGlobal(pt);
-		pt = sbRoot.globalToLocal(pt);			
-		
-		toolTip.move(pt.x, pt.y + (height - toolTip.height) / 2);
-
-		var screenRight:Number = screen.x + screen.width;
+        var pt:Point = new Point(0, 0);
+        pt = label.localToGlobal(pt);
+        pt = sbRoot.globalToLocal(pt);            
+        
+        toolTip.move(pt.x, pt.y + (height - toolTip.height) / 2);
+
+        var screenRight:Number = screen.x + screen.width;
         pt.x = toolTip.x;
         pt.y = toolTip.y;
         pt = sbRoot.localToGlobal(pt);
         if (pt.x + toolTip.width > screenRight)
             toolTip.move(toolTip.x - (pt.x + toolTip.width - screenRight), toolTip.y);
-	}
-
-	/**
-	 *  @private
-	 */
-	private function disclosureMouseDownHandler(event:Event):void
-	{
-		event.stopPropagation();
-		
-		if (listOwner.isOpening || !listOwner.enabled)
-			return;
-
-		var open:Boolean = _listData.open;
-		_listData.open = !open;
-		
-		listOwner.dispatchTreeEvent(TreeEvent.ITEM_OPENING,
-		                        _listData.item, //item
-                                this,  	//renderer
-                                event, 	//trigger
-                                !open, 	//opening
-    							true,  	//animate
-    							true)   //dispatch
-	}
-	
-	/**
-	 *  @private
-	 */
-	mx_internal function getLabel():IUITextField
-	{
-		return label;
-	}
-	
-	/**
-	 *  @private
-	 */
-	mx_internal function getDisclosureIcon():IFlexDisplayObject
-	{
-		return disclosureIcon;
-	}
+    }
+
+    /**
+     *  @private
+     */
+    private function disclosureIcon_mouseDownHandler(event:Event):void
+    {
+        event.stopPropagation();
+        
+        if (listOwner.isOpening || !listOwner.enabled)
+            return;
+
+        var open:Boolean = _listData.open;
+        _listData.open = !open;
+        
+        listOwner.dispatchTreeEvent(TreeEvent.ITEM_OPENING,
+                                _listData.item, //item
+                                this,      //renderer
+                                event,     //trigger
+                                !open,     //opening
+                                true,      //animate
+                                true)   //dispatch
+    }
+    
+    /**
+     *  @private
+     */
+    private function disclosureIcon_clickHandler(event:Event):void
+    {
+        // stop this event from bubbling up because the click is 
+        // for item selection and clicking on the disclosureIcon doesn't
+        // select the items (only expands/closes them).
+        event.stopPropagation();
+    }
+    
+    /**
+     *  @private
+     */
+    mx_internal function getLabel():IUITextField
+    {
+        return label;
+    }
+    
+    /**
+     *  @private
+     */
+    mx_internal function getDisclosureIcon():IFlexDisplayObject
+    {
+        return disclosureIcon;
+    }
 
 }
 

    }
    
    //----------------------------------
	//  icon
    //----------------------------------

	/**
	 *  The internal IFlexDisplayObject that displays the icon in this renderer.
	 *  
	 *  @langversion 3.0
	 *  @playerversion Flash 9
	 *  @playerversion AIR 1.1
	 *  @productversion Flex 3
	 */
	protected var icon:IFlexDisplayObject;
	
    //----------------------------------
	//  label
    //----------------------------------

	/**
	 *  The internal UITextField that displays the text in this renderer.
	 *  
	 *  @langversion 3.0
	 *  @playerversion Flash 9
	 *  @playerversion AIR 1.1
	 *  @productversion Flex 3
	 */
	protected var label:IUITextField;
	
    //----------------------------------
	//  listData
    //----------------------------------

	/**
	 *  @private
	 *  Storage for the listData property.
	 */
	private var _listData:TreeListData;

	[Bindable("dataChange")]

	/**
	 *  The implementation of the <code>listData</code> property as 
	 *  defined by the IDropInListItemRenderer interface.
	 *
	 *  @see mx.controls.listClasses.IDropInListItemRenderer
	 *  
	 *  @langversion 3.0
	 *  @playerversion Flash 9
	 *  @playerversion AIR 1.1
	 *  @productversion Flex 3
	 */
	public function get listData():BaseListData
	{
		return _listData;
	}

	/**
	 *  @private
	 */
	public function set listData(value:BaseListData):void
	{
		_listData = TreeListData(value);
		
		invalidateProperties();
	}

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

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

    /**
     *  @private
     */
    override protected function createChildren():void
    {
        super.createChildren();

        createLabel(-1);

        addEventListener(ToolTipEvent.TOOL_TIP_SHOW, toolTipShowHandler);
    }

    /**
     *  @private
     */
    override protected function commitProperties():void
    {
        super.commitProperties();

        // if the font changed and we already created the label, we will need to 
        // destory it so it can be re-created, possibly in a different swf context.
        if (hasFontContextChanged() && label != null)
        {
              var index:int = getChildIndex(DisplayObject(label));
            removeLabel();
             createLabel(index);
        }

        if (icon)
        {
            removeChild(DisplayObject(icon));
            icon = null;
        }

        if (disclosureIcon)
        {
            disclosureIcon.removeEventListener(MouseEvent.MOUSE_DOWN, 
                                                 disclosureIcon_mouseDownHandler);
            disclosureIcon.removeEventListener(MouseEvent.CLICK, 
                disclosureIcon_clickHandler);
            removeChild(DisplayObject(disclosureIcon));
            disclosureIcon = null;
        }

        if (_data != null)
        {
            listOwner = Tree(_listData.owner);

            if (_listData.disclosureIcon)
            {
                var disclosureIconClass:Class = _listData.disclosureIcon;
                var disclosureInstance:* = new disclosureIconClass();
                
                // If not already an interactive object, then we'll wrap 
                // in one so we can dispatch mouse events.
                if (!(disclosureInstance is InteractiveObject))
                {
                    var wrapper:SpriteAsset = new SpriteAsset();
                    wrapper.addChild(disclosureInstance as DisplayObject);
                    disclosureIcon = wrapper as IFlexDisplayObject;
                }
                else
                {
                    disclosureIcon = disclosureInstance;
                }

                addChild(disclosureIcon as DisplayObject);
                disclosureIcon.addEventListener(MouseEvent.MOUSE_DOWN,
                        disclosureIcon_mouseDownHandler);
                disclosureIcon.addEventListener(MouseEvent.CLICK,
                    disclosureIcon_clickHandler);
            }
            
            if (_listData.icon)
            {
                var iconClass:Class = _listData.icon;
                icon = new iconClass();

                addChild(DisplayObject(icon));
            }
            
            label.text = _listData.label;
            label.multiline = listOwner.variableRowHeight;
            label.wordWrap = listOwner.wordWrap;
        }
        else
        {
            label.text = " ";
            toolTip = null;
        }

        invalidateDisplayList();
    }

    /**
     *  @private
     */
    override protected function measure():void
    {
        super.measure();

        var w:Number = _data ? _listData.indent : 0;

        if (disclosureIcon)
            w += disclosureIcon.width;

        if (icon)
            w += icon.measuredWidth;

        // guarantee that label width isn't zero because it messes up ability to measure
        if (label.width < 4 || label.height < 4)
        {
            label.width = 4;
            label.height = 16;
        }

        if (isNaN(explicitWidth))
        {
            w += label.getExplicitOrMeasuredWidth();    
            measuredWidth = w;
            measuredHeight = label.getExplicitOrMeasuredHeight();
        }
        else
        {
            label.width = Math.max(explicitWidth - w, 4);
            measuredHeight = label.getExplicitOrMeasuredHeight();
            if (icon && icon.measuredHeight > measuredHeight)
                measuredHeight = icon.measuredHeight;
        }
    }

    /**
     *  @private
     */
    override protected function updateDisplayList(unscaledWidth:Number,
                                                  unscaledHeight:Number):void
    {
        super.updateDisplayList(unscaledWidth, unscaledHeight);

        var startx:Number = _data ? _listData.indent : 0;
        
        if (disclosureIcon)
        {
            disclosureIcon.x = startx;

            startx = disclosureIcon.x + disclosureIcon.width;
            
            disclosureIcon.setActualSize(disclosureIcon.width,
                                         disclosureIcon.height);
            
            disclosureIcon.visible = _data ?
                                     _listData.hasChildren :
                                     false;
        }
        
        if (icon)
        {
            icon.x = startx;
            startx = icon.x + icon.measuredWidth;
            icon.setActualSize(icon.measuredWidth, icon.measuredHeight);
        }
        
        label.x = startx;
        label.setActualSize(unscaledWidth - startx, measuredHeight);

        var verticalAlign:String = getStyle("verticalAlign");
        if (verticalAlign == "top")
        {
            label.y = 0;
            if (icon)
                icon.y = 0;
            if (disclosureIcon)
                disclosureIcon.y = 0;
        }
        else if (verticalAlign == "bottom")
        {
            label.y = unscaledHeight - label.height + 2; // 2 for gutter
            if (icon)
                icon.y = unscaledHeight - icon.height;
            if (disclosureIcon)
                disclosureIcon.y = unscaledHeight - disclosureIcon.height;
        }
        else
        {
            label.y = (unscaledHeight - label.height) / 2;
            if (icon)
                icon.y = (unscaledHeight - icon.height) / 2;
            if (disclosureIcon)
                disclosureIcon.y = (unscaledHeight - disclosureIcon.height) / 2;
        }

        var labelColor:Number;

        if (data && parent)
        {
            if (!enabled)
                labelColor = getStyle("disabledColor");

            else if (listOwner.isItemHighlighted(listData.uid))
                labelColor = getStyle("textRollOverColor");

            else if (listOwner.isItemSelected(listData.uid))
                labelColor = getStyle("textSelectedColor");

            else
                labelColor = getStyle("color");

               label.setColor(labelColor);
        }
        
        if (_data != null)
        {            
            if (listOwner.showDataTips)
            {
                if (label.textWidth > label.width ||
                    listOwner.dataTipFunction != null)
                {
                    toolTip = listOwner.itemToDataTip(_data);
                }
                else
                {
                    toolTip = null;
                }
            }
            else
            {
                toolTip = null;
            }
        }
    }
    
    //--------------------------------------------------------------------------
    //
    //  Methods
