 */
 package weave.ui
 {
+	import avmplus.getQualifiedClassName;
+	
 	import flash.display.DisplayObject;
 	import flash.display.DisplayObjectContainer;
 	
 	import mx.containers.Grid;
 	import mx.containers.GridItem;
 	import mx.containers.GridRow;
+	import mx.core.Container;
+	
+	import weave.core.ClassUtils;
 	
 	[DefaultProperty("dataProvider")]
 	

				for (var c:int = 0; c < gridItems.length; c++)
				{
					var gridItem:GridItem = gridItems[c] as GridItem;
					initChildren(gridItem, 0, null);
					gridRow.addChild(gridItem);
					var dataItem:Object = dataRow[c];
					var displayObject:DisplayObject = generator is Function
						? generator(dataItem) as DisplayObject
						: dataItem as DisplayObject;
					if (displayObject)
						gridItem.addChild(displayObject);
					
					for each (var style:String in ['horizontalAlign', 'verticalAlign'])
						gridItem.setStyle(style, grid.getStyle(style));
					

			}
		}
		
		private static function initChildren(container:DisplayObjectContainer, desiredNumber:uint, type:Class):Array
		{
			// remove unwanted children
			var i:int = container.numChildren;
			while (i-- && type && !(container.getChildAt(0) is type))
				container.removeChildAt(i);
			
			// remove extra children
			i = container.numChildren;
			while (i-- > desiredNumber)
				container.removeChildAt(i);
			
			var result:Array = [];
			for (i = 0; i < desiredNumber; i++)
			{
				if (i < container.numChildren) // existing child
					result.push(container.getChildAt(i));
				else if (type) // new child
					result.push(container.addChild(new type()));
			}
			return result;
