flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [4/5] git commit: [flex-asjs] [refs/heads/develop] - DataContainer, which is essentially a non-selectable List. It leverages IDataProviderModel which is a subset of ISelectionModel
Date Fri, 09 Dec 2016 15:12:18 GMT
DataContainer, which is essentially a non-selectable List.  It leverages IDataProviderModel
which is a subset of ISelectionModel


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

Branch: refs/heads/develop
Commit: 096f56271ff472fa1859b1e79326a03cd82dd0a4
Parents: 62b6ce0
Author: Alex Harui <aharui@apache.org>
Authored: Fri Dec 9 06:58:26 2016 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Dec 9 07:06:58 2016 -0800

----------------------------------------------------------------------
 .../org/apache/flex/core/IDataProviderModel.as  |  70 +++++
 .../org/apache/flex/core/ISelectionModel.as     |  35 +--
 .../projects/HTML/src/main/flex/HTMLClasses.as  |   2 +
 .../flex/org/apache/flex/html/DataContainer.as  | 255 +++++++++++++++++++
 .../apache/flex/html/beads/DataContainerView.as | 169 ++++++++++++
 .../DataItemRendererFactoryForArrayData.as      |  12 +-
 .../DataItemRendererFactoryForArrayList.as      |  12 +-
 ...ataItemRendererFactoryForHierarchicalData.as |   4 +-
 .../flex/html/beads/models/DataProviderModel.as | 117 +++++++++
 .../HTML/src/main/resources/basic-manifest.xml  |   1 +
 .../HTML/src/main/resources/defaults.css        |  15 ++
 11 files changed, 644 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataProviderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataProviderModel.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataProviderModel.as
new file mode 100644
index 0000000..8e154f9
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IDataProviderModel.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core
+{
+	import org.apache.flex.events.IEventDispatcher;
+
+    /**
+     *  The ISelectionModel interface describes the minimum set of properties
+     *  available to control that let the user select from within a
+     *  set of items in a dataProvider.  A more sophisticated model would
+     *  support multiple selection.
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public interface IDataProviderModel extends IEventDispatcher, IBeadModel
+	{
+        /**
+         *  The set of choices displayed in the ComboBox's
+         *  dropdown.  The dataProvider can be a simple 
+         *  array or vector if the set of choices is not
+         *  going to be modified (except by wholesale
+         *  replacement of the dataProvider).  To use
+         *  different kinds of data sets, you may need to
+         *  provide an alternate "mapping" bead that
+         *  iterates the dataProvider, generates item
+         *  renderers and assigns a data item to the
+         *  item renderers.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function get dataProvider():Object;
+        function set dataProvider(value:Object):void;
+        
+        // TODO: this is probably not needed in a selection model
+        //       and should be in a scheme mapper model.
+        /**
+         *  The property on the data item that the item renderer
+         *  should renderer.
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		function get labelField():String;
+		function set labelField(value:String):void;
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ISelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ISelectionModel.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ISelectionModel.as
index e918e47..3068286 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ISelectionModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ISelectionModel.as
@@ -31,29 +31,9 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public interface ISelectionModel extends IEventDispatcher, IBeadModel
+	public interface ISelectionModel extends IDataProviderModel
 	{
         /**
-         *  The set of choices displayed in the ComboBox's
-         *  dropdown.  The dataProvider can be a simple 
-         *  array or vector if the set of choices is not
-         *  going to be modified (except by wholesale
-         *  replacement of the dataProvider).  To use
-         *  different kinds of data sets, you may need to
-         *  provide an alternate "mapping" bead that
-         *  iterates the dataProvider, generates item
-         *  renderers and assigns a data item to the
-         *  item renderers.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        function get dataProvider():Object;
-        function set dataProvider(value:Object):void;
-        
-        /**
          *  The index of the selected item in the
          *  dataProvider.  Values less than 0 can
          *  have specific meanings but generally mean
@@ -83,18 +63,5 @@ package org.apache.flex.core
         function get selectedItem():Object;
         function set selectedItem(value:Object):void;
 
-        // TODO: this is probably not needed in a selection model
-        //       and should be in a scheme mapper model.
-        /**
-         *  The property on the data item that the item renderer
-         *  should renderer.
-         * 
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		function get labelField():String;
-		function set labelField(value:String):void;
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/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 a5ccd7c..23a48a5 100644
--- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -201,6 +201,8 @@ internal class HTMLClasses
 	import org.apache.flex.svg.Text; Text;
 	import org.apache.flex.svg.CompoundGraphic; CompoundGraphic;
 
+    import org.apache.flex.html.beads.models.DataProviderModel; DataProviderModel;
+    import org.apache.flex.html.beads.DataContainerView; DataContainerView;
 
 	COMPILE::SWF
 	{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as
new file mode 100644
index 0000000..5d33d55
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as
@@ -0,0 +1,255 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	import org.apache.flex.core.ContainerBaseStrandChildren;
+	import org.apache.flex.core.IContentViewHost;
+	import org.apache.flex.core.IDataProviderItemRendererMapper;
+	import org.apache.flex.core.IFactory;
+	import org.apache.flex.core.IItemRendererClassFactory;
+	import org.apache.flex.core.IItemRendererProvider;
+	import org.apache.flex.core.IListPresentationModel;
+	import org.apache.flex.core.IRollOverModel;
+	import org.apache.flex.core.IDataProviderModel;
+	import org.apache.flex.core.ListBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+        import org.apache.flex.html.beads.ListView;
+        import org.apache.flex.html.supportClasses.DataGroup;
+    }
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.beads.models.ListPresentationModel;
+	
+	/**
+	 *  Indicates that the initialization of the list is complete.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	[Event(name="initComplete", type="org.apache.flex.events.Event")]
+	
+	/**
+	 *  The List class is a component that displays multiple data items. The List uses
+	 *  the following bead types:
+	 * 
+	 *  org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider.
+	 *  org.apache.flex.core.IBeadView:  the bead that constructs the visual parts of the list.
+	 *  org.apache.flex.core.IBeadController: the bead that handles input and output.
+	 *  org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of
the itemRenderers.
+	 *  org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating
the itemRenders.
+	 *  org.apache.flex.core.IItemRenderer: the class or factory used to display an item in
the list.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataContainer extends ListBase implements IItemRendererProvider
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DataContainer()
+		{
+			super();
+			addEventListener("beadsAdded", beadsAddedHandler);
+		}
+		
+		/**
+		 *  The name of field within the data used for display. Each item of the
+		 *  data should have a property with this name.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get labelField():String
+		{
+			return IDataProviderModel(model).labelField;
+		}
+		public function set labelField(value:String):void
+		{
+            IDataProviderModel(model).labelField = value;
+		}
+		
+		/**
+		 *  The data being display by the List.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+        public function get dataProvider():Object
+        {
+            return IDataProviderModel(model).dataProvider;
+        }
+        public function set dataProvider(value:Object):void
+        {
+            IDataProviderModel(model).dataProvider = value;
+        }
+
+			
+		/**
+		 *  The presentation model for the list.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get presentationModel():IListPresentationModel
+		{
+			var presModel:IListPresentationModel = getBeadByType(IListPresentationModel) as IListPresentationModel;
+			if (presModel == null) {
+				presModel = new ListPresentationModel();
+				addBead(presModel);
+			}
+			return presModel;
+		}
+		
+		/**
+		 *  The default height of each cell in every column
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get rowHeight():Number
+		{
+			return presentationModel.rowHeight;
+		}
+		public function set rowHeight(value:Number):void
+		{
+			presentationModel.rowHeight = value;
+		}
+				
+		private var _itemRenderer:IFactory;
+		
+		/**
+		 *  The class or factory used to display each item.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get itemRenderer():IFactory
+		{
+			return _itemRenderer;
+		}
+		public function set itemRenderer(value:IFactory):void
+		{
+			_itemRenderer = value;
+		}
+		
+		/**
+		 * Returns whether or not the itemRenderer property has been set.
+		 *
+		 *  @see org.apache.flex.core.IItemRendererProvider
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get hasItemRenderer():Boolean
+		{
+			var result:Boolean = false;
+			
+			COMPILE::SWF {
+				result = _itemRenderer != null;
+			}
+			
+			COMPILE::JS {
+				var test:* = _itemRenderer;
+				result = _itemRenderer !== null && test !== undefined;
+			}
+			
+			return result;
+		}
+		
+		
+		/**
+		 * @private
+		 */
+		override public function addedToParent():void
+		{
+            super.addedToParent();
+            		
+			dispatchEvent(new Event("initComplete"));
+		}
+        
+		/**
+		 * @private
+		 */
+	    private function beadsAddedHandler(e:Event):void
+		{
+            if (getBeadByType(IDataProviderItemRendererMapper) == null)
+            {
+                var mapper:IDataProviderItemRendererMapper = new (ValuesManager.valuesImpl.getValue(this,
"iDataProviderItemRendererMapper")) as IDataProviderItemRendererMapper;
+                addBead(mapper);
+            }
+			var itemRendererFactory:IItemRendererClassFactory = getBeadByType(IItemRendererClassFactory)
as IItemRendererClassFactory;
+			if (!itemRendererFactory)
+			{
+				itemRendererFactory = new (ValuesManager.valuesImpl.getValue(this, "iItemRendererClassFactory"))
as IItemRendererClassFactory;
+				addBead(itemRendererFactory);
+			}
+		}
+		
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+            super.createElement();
+            className = 'List';
+            
+            return element;
+        }        
+
+        /**
+         * @flexjsignorecoercion org.apache.flex.html.beads.ListView 
+         * @flexjsignorecoercion org.apache.flex.html.supportClasses.DataGroup 
+         */
+        COMPILE::JS
+        override public function internalChildren():Array
+        {
+            var listView:ListView = getBeadByType(ListView) as ListView;
+            var dg:DataGroup = listView.dataGroup as DataGroup;
+            var renderers:Array = dg.internalChildren();
+            return renderers;
+        };
+   	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataContainerView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataContainerView.as
new file mode 100644
index 0000000..4ad5708
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataContainerView.as
@@ -0,0 +1,169 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.BeadViewBase;
+	import org.apache.flex.core.ContainerBase;
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IBeadView;
+	import org.apache.flex.core.ISelectableItemRenderer;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IItemRendererParent;
+	import org.apache.flex.core.IParent;
+    import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IDataProviderModel;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.Strand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.beads.models.ScrollBarModel;
+	import org.apache.flex.html.beads.models.SingleLineBorderModel;
+	import org.apache.flex.html.supportClasses.Border;
+	import org.apache.flex.html.supportClasses.DataGroup;
+	import org.apache.flex.html.supportClasses.ScrollBar;
+
+	/**
+	 *  The List class creates the visual elements of the org.apache.flex.html.List 
+	 *  component. A List consists of the area to display the data (in the dataGroup), any 
+	 *  scrollbars, and so forth.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataContainerView extends ContainerView implements IListView
+	{
+		public function DataContainerView()
+		{
+		}
+						
+		protected var listModel:IDataProviderModel;
+		
+		private var _border:Border;
+		
+		/**
+		 *  The border surrounding the org.apache.flex.html.List.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+        public function get border():Border
+        {
+            return _border;
+        }
+		
+		/**
+		 *  The area holding the itemRenderers.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get dataGroup():IItemRendererParent
+		{
+			(contentView as UIBase).className = "ListDataGroup";
+			return contentView as IItemRendererParent;
+		}
+				
+		/**
+		 * @private
+		 */
+		override public function get resizableView():IUIBase
+		{
+			return _strand as IUIBase;
+		}
+        
+        /**
+         * @private
+         */
+        override public function get host():IUIBase
+        {
+            return _strand as IUIBase;
+        }
+        		
+		/**
+		 *  @copy org.apache.flex.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			super.strand = value;
+		}
+		
+		override protected function completeSetup():void
+		{
+			super.completeSetup();
+			
+			// list is not interested in UI children, it wants to know when new items
+			// have been added or the dataProvider has changed.
+			
+			host.removeEventListener("childrenAdded", childrenChangedHandler);
+			host.removeEventListener("childrenAdded", performLayout);
+			host.addEventListener("itemsCreated", itemsCreatedHandler);
+			
+			listModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
+			listModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+		}
+		
+		protected var lastSelectedIndex:int = -1;
+		
+		/**
+		 * @private
+		 */
+		protected function itemsCreatedHandler(event:Event):void
+		{
+			performLayout(event);
+		}
+		
+		/**
+		 * @private
+		 */
+		protected function dataProviderChangeHandler(event:Event):void
+		{
+			performLayout(event);
+		}
+		        
+        /**
+         *  respond to a change in size or request to re-layout everything
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		override protected function resizeHandler(event:Event):void
+		{
+			super.resizeHandler(event);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/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 36a151f..e9a78af 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
@@ -24,7 +24,7 @@ package org.apache.flex.html.beads
 	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.IDataProviderModel;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.SimpleCSSStyles;
@@ -65,7 +65,7 @@ package org.apache.flex.html.beads
 			super(target);
 		}
 		
-		private var selectionModel:ISelectionModel;
+		private var dataProviderModel:IDataProviderModel;
 		
 		private var labelField:String;
 		
@@ -88,12 +88,12 @@ package org.apache.flex.html.beads
 		
 		private function finishSetup(event:Event):void
 		{
-			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			dataProviderModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
 			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
-			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+			dataProviderModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
 			
-			labelField = (listView.host as List).labelField;
+			labelField = dataProviderModel.labelField;
 			
 			if (!itemRendererFactory)
 			{
@@ -141,7 +141,7 @@ package org.apache.flex.html.beads
 		
 		private function dataProviderChangeHandler(event:Event):void
 		{
-			var dp:Array = selectionModel.dataProvider as Array;
+			var dp:Array = dataProviderModel.dataProvider as Array;
 			if (!dp)
 				return;
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/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 41af5b1..7fc7a90 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
@@ -25,7 +25,7 @@ package org.apache.flex.html.beads
 	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.IDataProviderModel;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.SimpleCSSStyles;
@@ -66,7 +66,7 @@ package org.apache.flex.html.beads
 			super(target);
 		}
 		
-		protected var selectionModel:ISelectionModel;
+		protected var dataProviderModel:IDataProviderModel;
 		
 		protected var labelField:String;
 		
@@ -89,12 +89,12 @@ package org.apache.flex.html.beads
 		
 		private function finishSetup(event:Event):void
 		{
-			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			dataProviderModel = _strand.getBeadByType(IDataProviderModel) as IDataProviderModel;
 			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
-			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+			dataProviderModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
 			
-			labelField = (listView.host as List).labelField;
+			labelField = dataProviderModel.labelField;
 			
 			if (!itemRendererFactory)
 			{
@@ -158,7 +158,7 @@ package org.apache.flex.html.beads
 		 */
 		protected function dataProviderChangeHandler(event:Event):void
 		{
-			var dp:IArrayList = selectionModel.dataProvider as IArrayList;
+			var dp:IArrayList = dataProviderModel.dataProvider as IArrayList;
 			if (!dp)
 				return;
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/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 5c9c59c..1cf4f57 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
@@ -24,7 +24,7 @@ package org.apache.flex.html.beads
 	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.IDataProviderModel;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.SimpleCSSStyles;
@@ -95,7 +95,7 @@ package org.apache.flex.html.beads
 		override protected function setData(ir:ISelectableItemRenderer, data:Object, index:int):void
 		{
 			// Set the listData with the depth of this item
-			var flatList:FlattenedList = selectionModel.dataProvider as FlattenedList;
+			var flatList:FlattenedList = dataProviderModel.dataProvider as FlattenedList;
 			var depth:int = flatList.getDepth(data);
 			var isOpen:Boolean = flatList.isOpen(data);
 			var hasChildren:Boolean = flatList.hasChildren(data);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataProviderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataProviderModel.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataProviderModel.as
new file mode 100644
index 0000000..8217922
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataProviderModel.as
@@ -0,0 +1,117 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.models
+{
+	import org.apache.flex.core.IDataProviderModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+			
+    /**
+     *  The DataProviderModel class is a model for
+     *  a dataProvider and an optional labelField.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class DataProviderModel extends EventDispatcher implements IDataProviderModel
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function DataProviderModel()
+		{
+		}
+
+		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;
+		}
+		
+		private var _dataProvider:Object;
+        
+        /**
+         *  @copy org.apache.flex.core.ISelectionModel#dataProvider
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function get dataProvider():Object
+		{
+			return _dataProvider;
+		}
+
+        /**
+         *  @private
+         */
+		public function set dataProvider(value:Object):void
+		{
+            if (value === _dataProvider) return;
+            
+            _dataProvider = value;
+			dispatchEvent(new Event("dataProviderChanged"));
+		}
+
+		private var _labelField:String = null;
+		
+        /**
+         *  @copy org.apache.flex.core.ISelectionModel#labelField
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function get labelField():String
+		{
+			return _labelField;
+		}
+
+        /**
+         *  @private
+         */
+		public function set labelField(value:String):void
+		{
+			if (value != _labelField) {
+				_labelField = value;
+				dispatchEvent(new Event("labelFieldChanged"));
+			}
+		}
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/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 ed6226e..36570e5 100644
--- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
@@ -37,6 +37,7 @@
     <component id="ToggleTextButton" class="org.apache.flex.html.ToggleTextButton"/>
     <component id="TextInput" class="org.apache.flex.html.TextInput"/>
     <component id="TextArea" class="org.apache.flex.html.TextArea"/>
+    <component id="DataContainer" class="org.apache.flex.html.DataContainer"/>
     <component id="List" class="org.apache.flex.html.List"/>
     <component id="SimpleList" class="org.apache.flex.html.SimpleList"/>
     <component id="CheckBox" class="org.apache.flex.html.CheckBox"/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/096f5627/frameworks/projects/HTML/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css
index b314532..2f88cca 100644
--- a/frameworks/projects/HTML/src/main/resources/defaults.css
+++ b/frameworks/projects/HTML/src/main/resources/defaults.css
@@ -129,6 +129,21 @@ ControlBar
 	border-width: 1px;*/
 }
 
+DataContainer
+{
+	IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataProviderModel");
+	IBeadView:  ClassReference("org.apache.flex.html.beads.DataContainerView");			
+	IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+	IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+	IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
+	IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+	IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+	IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
+	IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+	border-style: solid;
+	border-color: #222222;
+}
+
 /* ASJS */
 DataGrid
 {


Mime
View raw message