flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [19/30] git commit: [flex-asjs] [refs/heads/spark] - Added itemRendererCreated event to DataItemFactory* classes.
Date Wed, 14 Sep 2016 21:31:09 GMT
Added itemRendererCreated event to DataItemFactory* classes.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/db261add
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/db261add
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/db261add

Branch: refs/heads/spark
Commit: db261add7954b9855311e2170b62fa25add0b255
Parents: 2ebc6c2
Author: Peter Ent <pent@apache.org>
Authored: Thu Sep 8 14:25:40 2016 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Thu Sep 8 14:25:40 2016 -0400

----------------------------------------------------------------------
 .../projects/HTML/src/main/flex/HTMLClasses.as  |   1 -
 .../org/apache/flex/events/ItemRendererEvent.as |  90 +++++++++
 ...ererFactoryAndEventDispatcherForArrayData.as | 191 -------------------
 .../DataItemRendererFactoryForArrayData.as      |  22 ++-
 .../DataItemRendererFactoryForArrayList.as      |  13 +-
 ...ataItemRendererFactoryForHierarchicalData.as |   4 +
 .../TextItemRendererFactoryForArrayData.as      |  22 ++-
 ...extItemRendererFactoryForStringVectorData.as |  23 ++-
 .../HTML/src/main/resources/basic-manifest.xml  |   6 +
 9 files changed, 166 insertions(+), 206 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
index f5c0f41..51b5e48 100644
--- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -144,7 +144,6 @@ internal class HTMLClasses
     import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
 	import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
 	import org.apache.flex.html.beads.DataItemRendererFactoryForArrayList; DataItemRendererFactoryForArrayList;
-	import org.apache.flex.html.beads.DataItemRendererFactoryAndEventDispatcherForArrayData;
DataItemRendererFactoryAndEventDispatcherForArrayData;
 	import org.apache.flex.html.beads.DataItemRendererFactoryForHierarchicalData; DataItemRendererFactoryForHierarchicalData;
 	import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
 	import org.apache.flex.html.supportClasses.Viewport; Viewport;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/events/ItemRendererEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/events/ItemRendererEvent.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/events/ItemRendererEvent.as
new file mode 100644
index 0000000..f4044a4
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/events/ItemRendererEvent.as
@@ -0,0 +1,90 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.events
+{
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.events.CustomEvent;
+	
+	/**
+	 * The ItemRendererEvent is dispatched by DataItemRendererFactory classes under
+	 * various conditions.
+	 *
+	 * @langversion 3.0
+	 * @playerversion Flash 10.2
+	 * @playerversion AIR 2.6
+	 * @productversion FlexJS 0.0
+	 */
+	public class ItemRendererEvent extends CustomEvent
+	{
+		// dispatched when a new itemRenderer has been created and added to the IItemRendererParent.
+		static public const CREATED:String = "itemRendererCreated";
+		
+		//--------------------------------------
+		//   Constructor
+		//--------------------------------------
+
+		/**
+		 * Constructor.
+		 *
+		 * @param type The name of the event.
+		 * @param bubbles Whether the event bubbles.
+		 * @param cancelable Whether the event can be canceled.
+		 *
+		 * @langversion 3.0
+		 * @playerversion Flash 10.2
+		 * @playerversion AIR 2.6
+		 * @productversion FlexJS 0.0
+		 */
+		public function ItemRendererEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+		{
+            COMPILE::SWF
+            {
+                super(type, bubbles, cancelable);                    
+            }
+            COMPILE::JS
+            {
+                super(type);
+            }
+			
+			itemRenderer = null;
+		}
+		
+		/**
+		 * The itemRenderer that has been created.
+		 *
+		 * @export
+		 * @langversion 3.0
+		 * @playerversion Flash 10.2
+		 * @playerversion AIR 2.6
+		 * @productversion FlexJS 0.0
+		 */
+		public var itemRenderer:IItemRenderer;
+		
+		/**
+		 * @private
+		 */
+		override public function cloneEvent():org.apache.flex.events.Event
+		{
+			var newEvent:ItemRendererEvent = new ItemRendererEvent(type);
+			newEvent.itemRenderer = itemRenderer;
+			return newEvent;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
deleted file mode 100644
index 3c55c60..0000000
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
+++ /dev/null
@@ -1,191 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IDataProviderItemRendererMapper;
-	import org.apache.flex.core.IItemRendererClassFactory;
-	import org.apache.flex.core.IItemRendererParent;
-	import org.apache.flex.core.IListPresentationModel;
-	import org.apache.flex.core.ISelectableItemRenderer;
-	import org.apache.flex.core.ISelectionModel;
-	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.IUIBase;
-	import org.apache.flex.core.SimpleCSSStyles;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.ValuesManager;
-	import org.apache.flex.events.Event;
-	import org.apache.flex.events.EventDispatcher;
-	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.html.List;
-
-    /**
-     *  The DataItemRendererFactoryAndEventDispatcherForArrayData class reads an
-     *  array of data and creates an item renderer for every
-     *  item in the array.  As each itemRenderer is created, a function is called
-	 *  that can be overridden in a subclass. Other implementations of
-     *  IDataProviderItemRendererMapper map different data
-     *  structures or manage a virtual set of renderers.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-	public class DataItemRendererFactoryAndEventDispatcherForArrayData extends EventDispatcher
implements IBead, IDataProviderItemRendererMapper
-	{
-        /**
-         *  Constructor.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function DataItemRendererFactoryAndEventDispatcherForArrayData()
-		{
-			super()
-		}
-
-		private var selectionModel:ISelectionModel;
-
-		private var labelField:String;
-
-		private var _strand:IStrand;
-
-        /**
-         *  @copy org.apache.flex.core.IBead#strand
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
-			if (listView == null) {
-				IEventDispatcher(_strand).addEventListener("viewChanged", completeSetup);
-			}
-			else {
-				completeSetup(null);
-			}
-		}
-
-		private function completeSetup(event:Event):void
-		{
-			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
-			dataGroup = listView.dataGroup;
-			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
-			labelField = (listView.host as List).labelField;
-
-			if (!itemRendererFactory)
-			{
-				_itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory"))
as IItemRendererClassFactory;
-				_strand.addBead(_itemRendererFactory);
-			}
-
-			dataProviderChangeHandler(null);
-		}
-
-		private var _itemRendererFactory:IItemRendererClassFactory;
-
-        /**
-         *  The org.apache.flex.core.IItemRendererClassFactory used
-         *  to generate instances of item renderers.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function get itemRendererFactory():IItemRendererClassFactory
-		{
-			return _itemRendererFactory;
-		}
-
-        /**
-         *  @private
-         */
-		public function set itemRendererFactory(value:IItemRendererClassFactory):void
-		{
-			_itemRendererFactory = value;
-		}
-
-        /**
-         *  The org.apache.flex.core.IItemRendererParent that will
-         *  parent the item renderers.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		protected var dataGroup:IItemRendererParent;
-
-		private function dataProviderChangeHandler(event:Event):void
-		{
-			var dp:Array = selectionModel.dataProvider as Array;
-			if (!dp)
-				return;
-
-			dataGroup.removeAllElements();
-
-			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
-			var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel)
as IListPresentationModel;
-
-			var n:int = dp.length;
-			for (var i:int = 0; i < n; i++)
-			{
-				var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as
ISelectableItemRenderer;
-				ir.index = i;
-				ir.labelField = labelField;
-				if (presentationModel) {
-					var style:SimpleCSSStyles = new SimpleCSSStyles();
-					style.marginBottom = presentationModel.separatorThickness;
-					UIBase(ir).style = style;
-					UIBase(ir).height = presentationModel.rowHeight;
-				}
-				dataGroup.addElement(ir);
-				ir.data = dp[i];
-
-				itemRendererCreated(ir);
-			}
-
-			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
-		}
-
-		/**
-		 * Override this function in a subclass to hook event listeners or other features into
-		 * the itemRenderer when it has been created and set.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-		 */
-		protected function itemRendererCreated(ir:ISelectableItemRenderer):void
-		{
-			// do something with this in a subclass
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
index 609bfbc..49e6fcc 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
@@ -31,9 +31,13 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
 	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.events.ItemRendererEvent;
 	import org.apache.flex.html.List;
 	
+	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
+	
     /**
      *  The DataItemRendererFactoryForArrayData class reads an
      *  array of data and creates an item renderer for every
@@ -46,7 +50,7 @@ package org.apache.flex.html.beads
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class DataItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
+	public class DataItemRendererFactoryForArrayData extends EventDispatcher implements IBead,
IDataProviderItemRendererMapper
 	{
         /**
          *  Constructor.
@@ -56,8 +60,9 @@ package org.apache.flex.html.beads
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-		public function DataItemRendererFactoryForArrayData()
+		public function DataItemRendererFactoryForArrayData(target:Object=null)
 		{
+			super(target);
 		}
 		
 		private var selectionModel:ISelectionModel;
@@ -77,8 +82,13 @@ package org.apache.flex.html.beads
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = value.getBeadByType(IListView) as IListView;
+			IEventDispatcher(value).addEventListener("beadsAdded",finishSetup);
+		}
+		
+		private function finishSetup(event:Event):void
+		{
+			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
 			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
 			
@@ -153,6 +163,10 @@ package org.apache.flex.html.beads
 				}
 				dataGroup.addElement(ir);
 				ir.data = dp[i];
+				
+				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
+				newEvent.itemRenderer = ir;
+				dispatchEvent(newEvent);
 			}
 			
 			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
index 901b5f3..42b159c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
@@ -33,8 +33,12 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.ItemRendererEvent;
 	import org.apache.flex.html.List;
 	
+	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
+	
     /**
      *  The DataItemRendererFactoryForArrayList class uses an ArrayList
 	 *  and creates an item renderer for every
@@ -47,7 +51,7 @@ package org.apache.flex.html.beads
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class DataItemRendererFactoryForArrayList implements IBead, IDataProviderItemRendererMapper
+	public class DataItemRendererFactoryForArrayList extends EventDispatcher implements IBead,
IDataProviderItemRendererMapper
 	{
         /**
          *  Constructor.
@@ -57,8 +61,9 @@ package org.apache.flex.html.beads
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-		public function DataItemRendererFactoryForArrayList()
+		public function DataItemRendererFactoryForArrayList(target:Object=null)
 		{
+			super(target);
 		}
 		
 		protected var selectionModel:ISelectionModel;
@@ -177,6 +182,10 @@ package org.apache.flex.html.beads
 				}
 				dataGroup.addElement(ir);
 				setData(ir, dp.getItemAt(i), i);
+				
+				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
+				newEvent.itemRenderer = ir;
+				dispatchEvent(newEvent);
 			}
 			
 			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForHierarchicalData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForHierarchicalData.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForHierarchicalData.as
index 58bfd21..5c9c59c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForHierarchicalData.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForHierarchicalData.as
@@ -31,10 +31,14 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.ItemRendererEvent;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.List;
 	import org.apache.flex.html.supportClasses.TreeListData;
 	import org.apache.flex.collections.FlattenedList;
+	
+	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
 
     /**
      *  The DataItemRendererFactoryForHierarchicalData class reads a

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
index f500094..9eda39c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
@@ -26,7 +26,11 @@ package org.apache.flex.html.beads
     import org.apache.flex.core.IStrand;
     import org.apache.flex.core.ValuesManager;
     import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.ItemRendererEvent;
     import org.apache.flex.events.IEventDispatcher;
+	
+	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
 
     /**
      *  The TextItemRendererFactoryForArrayData class is the 
@@ -41,7 +45,7 @@ package org.apache.flex.html.beads
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class TextItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
+	public class TextItemRendererFactoryForArrayData extends EventDispatcher implements IBead,
IDataProviderItemRendererMapper
 	{
         /**
          *  Constructor.
@@ -51,8 +55,9 @@ package org.apache.flex.html.beads
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-		public function TextItemRendererFactoryForArrayData()
+		public function TextItemRendererFactoryForArrayData(target:Object=null)
 		{
+			super(target);
 		}
 		
 		private var selectionModel:ISelectionModel;
@@ -70,8 +75,13 @@ package org.apache.flex.html.beads
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = value.getBeadByType(IListView) as IListView;
+			IEventDispatcher(value).addEventListener("beadsAdded",finishSetup);
+		}
+		
+		private function finishSetup(event:Event):void
+		{
+			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
 			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
             
@@ -135,6 +145,10 @@ package org.apache.flex.html.beads
                     tf.text = dp[i][selectionModel.labelField];
                 else
     				tf.text = dp[i];
+				
+				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
+				newEvent.itemRenderer = tf;
+				dispatchEvent(newEvent);
 			}
 			
 			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
index 5c034d9..b0c11b5 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
@@ -25,6 +25,11 @@ package org.apache.flex.html.beads
     import org.apache.flex.core.ISelectionModel;
     import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.events.ItemRendererEvent;
+	
+	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
 
     /**
      *  The TextItemRendererFactoryForStringVectorData class is the 
@@ -39,7 +44,7 @@ package org.apache.flex.html.beads
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class TextItemRendererFactoryForStringVectorData implements IBead
+	public class TextItemRendererFactoryForStringVectorData extends EventDispatcher implements
IBead
 	{
         /**
          *  Constructor.
@@ -49,8 +54,9 @@ package org.apache.flex.html.beads
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-		public function TextItemRendererFactoryForStringVectorData()
+		public function TextItemRendererFactoryForStringVectorData(target:Object=null)
 		{
+			super(target);
 		}
 		
 		private var selectionModel:ISelectionModel;
@@ -68,8 +74,13 @@ package org.apache.flex.html.beads
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = value.getBeadByType(IListView) as IListView;
+			IEventDispatcher(value).addEventListener("beadsAdded",finishSetup);
+		}
+		
+		private function finishSetup(event:Event):void
+		{
+			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
 			selectionModel.addEventListener("dataProviderChange", dataProviderChangeHandler);
 			dataProviderChangeHandler(null);
@@ -121,6 +132,10 @@ package org.apache.flex.html.beads
                 tf.index = i;
                 dataGroup.addElement(tf);
 				tf.text = dp[i];
+				
+				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
+				newEvent.itemRenderer = tf;
+				dispatchEvent(newEvent);
 			}			
 		}
 		

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/db261add/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
index baa4ff0..604fdd7 100644
--- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
@@ -91,6 +91,12 @@
     <component id="DataGridButtonBarTextButton" class="org.apache.flex.html.DataGridButtonBarTextButton"/>
     <component id="DataGridColumn" class="org.apache.flex.html.supportClasses.DataGridColumn"/>
     <component id="DataGridLinesBead" class="org.apache.flex.html.beads.DataGridLinesBead"/>
+    
+    <component id="DataItemRendererFactoryForArrayData" class="org.apache.flex.html.beads.DataItemRendererFactoryForArrayData"
/>
+    <component id="DataItemRendererFactoryForArrayList" class="org.apache.flex.html.beads.DataItemRendererFactoryForArrayList"
/>
+    <component id="DataItemRendererFactoryForHierarchicalData" class="org.apache.flex.html.beads.DataItemRendererFactoryForHierarchicalData"
/>
+    <component id="TextItemRendererFactoryForArrayData" class="org.apache.flex.html.beads.TextItemRendererFactoryForArrayData"
/>
+    <component id="TextItemRendererFactoryForStringVectorData" class="org.apache.flex.html.beads.TextItemRendererFactoryForStringVectorData"
/>
 
     <component id="DateChooser" class="org.apache.flex.html.DateChooser"/>
     <component id="DateField" class="org.apache.flex.html.DateField"/>


Mime
View raw message