flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject svn commit: r1441624 - in /flex/asjs/branches/develop/frameworks/as/src/org/apache/flex: core/ html/staticControls/ html/staticControls/beads/ html/staticControls/beads/controllers/ html/staticControls/beads/layouts/ html/staticControls/beads/models/ h...
Date Fri, 01 Feb 2013 20:47:29 GMT
Author: aharui
Date: Fri Feb  1 20:47:28 2013
New Revision: 1441624

URL: http://svn.apache.org/viewvc?rev=1441624&view=rev
Log:
A List

Added:
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as   (with props)
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as   (with props)

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.events.IEventDispatcher;
+
+	public interface IItemRenderer extends IEventDispatcher
+	{
+		function get data():Object;
+		function set data(value:Object):void;
+		
+		function get index():int;
+		function set index(value:int):void;
+		
+		function get selected():Boolean;
+		function set selected(value:Boolean):void;
+        
+        function get hovered():Boolean;
+        function set hovered(value:Boolean):void;
+
+        function get down():Boolean;
+        function set down(value:Boolean):void;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRenderer.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	public interface IItemRendererClassFactory
+	{
+		function createItemRenderer(parent:IItemRendererParent):IItemRenderer;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererClassFactory.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.display.DisplayObject;
+	import flash.events.IEventDispatcher;
+
+	public interface IItemRendererParent extends IEventDispatcher
+	{
+		function getItemRendererForIndex(index:int):IItemRenderer;
+        function addChild(child:DisplayObject):DisplayObject;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IItemRendererParent.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.events.IEventDispatcher;
+
+	public interface ISelectionModel extends IEventDispatcher, IBeadModel
+	{
+		function get dataProvider():Object;
+		function set dataProvider(value:Object):void;
+		
+		function get selectedIndex():int;
+		function set selectedIndex(value:int):void;
+		
+		function get selectedItem():Object;
+		function set selectedItem(value:Object):void;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ISelectionModel.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.display.DisplayObjectContainer;
+    import org.apache.flex.utils.MXMLDataInterpreter;
+
+	[DefaultProperty("mxmlContent")]
+	public class ItemRendererClassFactory implements IItemRendererClassFactory, IDocument
+	{
+		public function ItemRendererClassFactory()
+		{
+			super();
+		}
+				
+		public function get MXMLDescriptor():Array
+		{
+			return null;
+		}
+		
+		public function get MXMLProperties():Array
+		{
+			return null;
+		}
+		
+		public var mxmlContent:Array;
+		
+        public function createItemRenderer(parent:IItemRendererParent):IItemRenderer
+        {
+            return createFunction(parent);
+        }
+        
+        public var createFunction:Function = createFromMXMLContent;
+
+        protected function createFromMXMLContent(parent:IItemRendererParent):IItemRenderer
+        {
+            return MXMLDataInterpreter.generateMXMLArray(document, parent as DisplayObjectContainer, MXMLDescriptor, true)[0];
+        }
+        
+        private var document:Object;
+        public function setDocument(document:Object, id:String = null):void
+        {
+            this.document = document;
+        }
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/ItemRendererClassFactory.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls
+{
+	import org.apache.flex.core.IInitSkin;
+	import org.apache.flex.core.ISelectionModel;
+	import org.apache.flex.core.UIBase;
+	
+	/**
+	 *  Label probably should extend TextField directly,
+	 *  but the player's APIs for TextLine do not allow
+	 *  direct instantiation, and we might want to allow
+	 *  Labels to be declared and have their actual
+	 *  view be swapped out.
+	 */
+	public class List extends UIBase implements IInitSkin
+	{
+		public function List()
+		{
+			super();
+		}
+		
+		public function get selectedIndex():int
+		{
+			return ISelectionModel(model).selectedIndex;
+		}
+		public function set selectedIndex(value:int):void
+		{
+			ISelectionModel(model).selectedIndex = value;
+		}
+		
+		public function get selectedItem():Object
+		{
+			return ISelectionModel(model).selectedItem;
+		}
+		public function set selectedItem(value:Object):void
+		{
+			ISelectionModel(model).selectedItem = value;
+		}
+		
+		override public function initModel():void
+		{
+		}
+		
+		public function initSkin():void
+		{
+		}
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/List.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{	
+	import org.apache.flex.core.IItemRendererParent;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.html.staticControls.supportClasses.Border;
+	import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
+
+	public interface IListBead
+	{
+        function get border():Border;
+		function get vScrollBar():ScrollBar;
+		function get dataGroup():IItemRendererParent;
+		function get strand():IStrand;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListBead.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import org.apache.flex.core.IItemRenderer;
+
+	public interface ITextItemRenderer extends IItemRenderer
+	{
+        function get text():String;
+        function set text(value:String):void;
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextItemRenderer.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,170 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import flash.events.Event;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IInitSkin;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IItemRendererParent;
+	import org.apache.flex.core.ISelectionModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.html.staticControls.beads.controllers.VScrollBarMouseController;
+	import org.apache.flex.html.staticControls.beads.layouts.VScrollBarLayout;
+	import org.apache.flex.html.staticControls.beads.models.ScrollBarModel;
+	import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
+	import org.apache.flex.html.staticControls.supportClasses.Border;
+	import org.apache.flex.html.staticControls.supportClasses.NonVirtualDataGroup;
+	import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
+
+	public class ListBead implements IBead, IInitSkin, IStrand, IListBead
+	{
+		public function ListBead()
+		{
+		}
+						
+		private var listModel:ISelectionModel;
+		
+        private var _border:Border;
+        
+        public function get border():Border
+        {
+            return _border;
+        }
+
+        private var _dataGroup:IItemRendererParent;
+
+		public function get dataGroup():IItemRendererParent
+		{
+			return _dataGroup;
+		}
+		
+		private var _vScrollBar:ScrollBar;
+		
+		public function get vScrollBar():ScrollBar
+		{
+            if (!_vScrollBar)
+                _vScrollBar = createScrollBar();
+			return _vScrollBar;
+		}
+
+		private var _strand:IStrand;
+		
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+            _border = new Border();
+            border.addToParent(UIBase(_strand));
+            _border.model = new SingleLineBorderModel();
+            _border.addBead(new SingleLineBorderBead());
+			_dataGroup = new NonVirtualDataGroup();
+			UIBase(_dataGroup).addToParent(UIBase(_strand));
+			listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+			listModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+		}
+		
+		private var lastSelectedIndex:int = -1;
+		
+		private function selectionChangeHandler(event:Event):void
+		{
+			if (lastSelectedIndex != -1)
+			{
+				var ir:IItemRenderer = dataGroup.getItemRendererForIndex(lastSelectedIndex) as IItemRenderer;
+                ir.selected = false;
+			}
+            ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex);
+            ir.selected = true;
+            lastSelectedIndex = listModel.selectedIndex;
+		}
+			
+		public function initSkin():void
+		{
+		}
+						
+		private function createScrollBar():ScrollBar
+		{
+			var vsb:ScrollBar;
+			vsb = new ScrollBar();
+			vsb.addToParent(UIBase(_strand));
+			var vsbm:ScrollBarModel = new ScrollBarModel();
+			vsbm.maximum = 100;
+			vsbm.minimum = 0;
+			vsbm.pageSize = 10;
+			vsbm.pageStepSize = 10;
+			vsbm.snapInterval = 1;
+			vsbm.stepSize = 1;
+			vsbm.value = 0;
+			vsb.model = vsbm;
+			vsb.initModel();
+			vsb.width = 16;
+			var vsbb:ScrollBarBead = new ScrollBarBead();
+			vsbb.initSkin();
+			vsb.addBead(vsbb);	
+			var vsbl:VScrollBarLayout = new VScrollBarLayout();
+			vsbb.addBead(vsbl);
+			var vsbc:VScrollBarMouseController = new VScrollBarMouseController();
+			vsb.addBead(vsbc);
+			return vsb;
+		}
+				
+		// beads declared in MXML are added to the strand.
+		// from AS, just call addBead()
+		public var beads:Array;
+		
+		private var _beads:Vector.<IBead>;
+		public function addBead(bead:IBead):void
+		{
+			if (!_beads)
+				_beads = new Vector.<IBead>;
+			_beads.push(bead);
+			bead.strand = this;
+		}
+		
+		public function getBeadByType(classOrInterface:Class):IBead
+		{
+			for each (var bead:IBead in _beads)
+			{
+				if (bead is classOrInterface)
+					return bead;
+			}
+			return null;
+		}
+		
+		public function removeBead(value:IBead):IBead	
+		{
+			var n:int = _beads.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				var bead:IBead = _beads[i];
+				if (bead == value)
+				{
+					_beads.splice(i, 1);
+					return bead;
+				}
+			}
+			return null;
+		}
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+    import flash.display.DisplayObject;
+    import flash.events.Event;
+    
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IItemRendererClassFactory;
+    import org.apache.flex.core.IItemRendererParent;
+    import org.apache.flex.core.ISelectionModel;
+    import org.apache.flex.core.IStrand;
+
+	public class TextItemRendererFactoryForStringVectorData implements IBead
+	{
+		public function TextItemRendererFactoryForStringVectorData()
+		{
+
+		}
+		
+		private var selectionModel:ISelectionModel;
+		
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+			var listBead:IListBead = value.getBeadByType(IListBead) as IListBead;
+			dataGroup = listBead.dataGroup;
+			selectionModel.addEventListener("dataProviderChange", dataProviderChangeHandler);
+			dataProviderChangeHandler(null);
+		}
+		
+        public var itemRendererFactory:IItemRendererClassFactory;
+        
+		public var dataGroup:IItemRendererParent;
+		
+		private function dataProviderChangeHandler(event:Event):void
+		{
+			var dp:Vector.<String> = selectionModel.dataProvider as Vector.<String>;
+			var n:int = dp.length; 
+			for (var i:int = 0; i < n; i++)
+			{
+				var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
+                tf.index = i;
+				dataGroup.addChild(tf as DisplayObject);
+				tf.text = dp[i];
+			}			
+		}
+		
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextItemRendererFactoryForStringVectorData.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.controllers
+{
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+	import flash.events.IEventDispatcher;
+	import flash.events.MouseEvent;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IStrand;
+
+	public class ItemRendererMouseController implements IBead
+	{
+		public function ItemRendererMouseController()
+		{
+		}
+		
+        private var renderer:IItemRenderer;
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+            renderer = value as IItemRenderer;
+            renderer.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
+            renderer.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
+            renderer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+		}
+		
+		protected function rollOverHandler(event:MouseEvent):void
+		{
+			var target:IItemRenderer = event.target as IItemRenderer;
+			if (target)
+			{
+                target.hovered = true;
+			}
+		}
+		
+		protected function rollOutHandler(event:MouseEvent):void
+		{
+			var target:IItemRenderer = event.target as IItemRenderer;
+			if (target)
+			{
+                target.hovered = false;
+                target.down = false;
+			}
+		}
+
+		protected function mouseDownHandler(event:MouseEvent):void
+		{
+			var target:IItemRenderer = event.target as IItemRenderer;
+			if (target)
+			{
+                target.down = true;
+				target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+			}
+		}
+		
+		protected function mouseUpHandler(event:MouseEvent):void
+		{
+			var target:IItemRenderer = event.target as IItemRenderer;
+			if (target)
+			{
+                target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);                
+				target.selected = true;
+				target.dispatchEvent(new Event("selected"));
+			}			
+		}
+	
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ItemRendererMouseController.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.controllers
+{
+	import flash.events.Event;
+    import flash.events.IEventDispatcher;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IItemRendererParent;
+	import org.apache.flex.core.ISelectionModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.html.staticControls.beads.IListBead;
+
+	public class ListSingleSelectionMouseController implements IBead
+	{
+		public function ListSingleSelectionMouseController()
+		{
+		}
+		
+		protected var listModel:ISelectionModel;
+		protected var listView:IListBead;
+		protected var dataGroup:IItemRendererParent;
+
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+			listView = value.getBeadByType(IListBead) as IListBead;
+			dataGroup = listView.dataGroup;
+            dataGroup.addEventListener("selected", selectedHandler, true);
+		}
+		
+        private function selectedHandler(event:Event):void
+        {
+            listModel.selectedIndex = IItemRenderer(event.target).index;
+            IEventDispatcher(listView.strand).dispatchEvent(new Event("change"));
+        }
+	
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,108 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.layouts
+{
+	import flash.display.DisplayObject;
+	import flash.display.DisplayObjectContainer;
+	import flash.events.Event;
+	import flash.events.IEventDispatcher;
+	import flash.geom.Rectangle;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IBorderModel;
+	import org.apache.flex.core.IScrollBarModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.html.staticControls.beads.IListBead;
+	import org.apache.flex.html.staticControls.supportClasses.Border;
+	import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
+
+	public class NonVirtualVerticalScrollingLayout implements IBead
+	{
+		public function NonVirtualVerticalScrollingLayout()
+		{
+		}
+		
+		public var dataGroup:DisplayObjectContainer;
+        
+        private var border:Border;		
+        private var borderModel:IBorderModel
+        private var vScrollBar:ScrollBar;		
+		private var listBead:IListBead;
+
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			listBead = value as IListBead;
+			dataGroup = listBead.dataGroup as DisplayObjectContainer;
+            border = listBead.border;
+            borderModel = border.model as IBorderModel;
+			IEventDispatcher(listBead.strand).addEventListener("heightChanged", changeHandler);
+			IEventDispatcher(listBead.strand).addEventListener("widthChanged", changeHandler);
+			changeHandler(null);
+		}
+	
+		private function changeHandler(event:Event):void
+		{            
+            var ww:Number = DisplayObject(listBead.strand).width;
+            var hh:Number = DisplayObject(listBead.strand).height;
+            border.width = ww;
+            border.height = hh;
+           
+			dataGroup.width = ww - borderModel.offsets.left - borderModel.offsets.right;
+			dataGroup.height = hh - borderModel.offsets.top - borderModel.offsets.bottom;
+            dataGroup.x = borderModel.offsets.left;
+            dataGroup.y = borderModel.offsets.top;
+			
+			var n:int = dataGroup.numChildren;
+			var yy:Number = 0;
+			for (var i:int = 0; i < n; i++)
+			{
+				var ir:DisplayObject = dataGroup.getChildAt(i);
+				ir.y = yy;
+				ir.width = dataGroup.width;
+				yy += ir.height;			
+			}
+			if (yy > dataGroup.height)
+			{
+                vScrollBar = listBead.vScrollBar;
+				dataGroup.width -= vScrollBar.width;
+				IScrollBarModel(vScrollBar.model).maximum = yy;
+				IScrollBarModel(vScrollBar.model).pageSize = dataGroup.height;
+				IScrollBarModel(vScrollBar.model).pageStepSize = dataGroup.height;
+				vScrollBar.visible = true;
+				vScrollBar.height = dataGroup.height;
+				vScrollBar.y = dataGroup.y;
+				vScrollBar.x = dataGroup.width;
+                var vpos:Number = IScrollBarModel(vScrollBar.model).value;
+                dataGroup.scrollRect = new Rectangle(0, vpos, dataGroup.width, vpos + dataGroup.height);
+                vScrollBar.addEventListener("scroll", scrollHandler);
+			}
+			else if (vScrollBar)
+				vScrollBar.visible = false;
+		}
+
+        private function scrollHandler(event:Event):void
+        {
+            var vpos:Number = IScrollBarModel(vScrollBar.model).value;
+            dataGroup.scrollRect = new Rectangle(0, vpos, dataGroup.width, vpos + dataGroup.height);
+        }
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.models
+{
+	import flash.events.Event;
+	import flash.events.EventDispatcher;
+	
+	import org.apache.flex.core.ISelectionModel;
+	import org.apache.flex.core.IStrand;
+		
+	public class StringSelectionModel extends EventDispatcher implements ISelectionModel
+	{
+		public function StringSelectionModel()
+		{
+		}
+
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+		}
+		
+		private var _strings:Vector.<String>;
+		public function get strings():Vector.<String>
+		{
+			return _strings;
+		}
+		public function set strings(value:Vector.<String>):void
+		{
+			_strings = value;
+			dispatchEvent(new Event("dataProviderChanged"));
+		}
+		public function get dataProvider():Object
+		{
+			return _strings;
+		}
+		public function set dataProvider(value:Object):void
+		{
+			_strings = value as Vector.<String>;
+			dispatchEvent(new Event("dataProviderChanged"));
+		}
+
+		private var _selectedIndex:int = -1;
+		
+		public function get selectedIndex():int
+		{
+			return _selectedIndex;
+		}
+		public function set selectedIndex(value:int):void
+		{
+			_selectedIndex = value;
+			_selectedString = (value == -1) ? null : (value < _strings.length) ? _strings[value] : null;
+			dispatchEvent(new Event("selectedIndexChanged"));			
+		}
+		private var _selectedString:String;
+		
+		public function get selectedItem():Object
+		{
+			return _selectedString;
+		}
+		public function set selectedItem(value:Object):void
+		{
+			selectedString = String(value);	
+		}
+		public function get selectedString():String
+		{
+			return _selectedString;
+		}
+		public function set selectedString(value:String):void
+		{
+			_selectedString = value;
+			var n:int = _strings.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				if (_strings[i] == value)
+				{
+					_selectedIndex = i;
+					break;
+				}
+			}
+			dispatchEvent(new Event("selectedItemChanged"));			
+		}
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/StringSelectionModel.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.supportClasses
+{	
+    import org.apache.flex.core.IItemRenderer;
+    import org.apache.flex.core.IItemRendererParent;
+    import org.apache.flex.core.UIBase;
+
+	public class NonVirtualDataGroup extends UIBase implements IItemRendererParent
+	{
+		public function NonVirtualDataGroup()
+		{
+			super();
+		}
+
+        public function getItemRendererForIndex(index:int):IItemRenderer
+        {
+            return getChildAt(index) as IItemRenderer;
+        }
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as?rev=1441624&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as (added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as Fri Feb  1 20:47:28 2013
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.supportClasses
+{
+    import flash.text.TextField;
+    import flash.text.TextFieldAutoSize;
+    import flash.text.TextFieldType;
+    
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.html.staticControls.beads.ITextItemRenderer;
+	
+	public class TextFieldItemRenderer extends TextField implements ITextItemRenderer, IStrand
+	{
+		public function TextFieldItemRenderer()
+		{
+			super();
+            type = TextFieldType.DYNAMIC;
+            selectable = false;
+		}
+        
+        public var highlightColor:uint = 0xFF0000;
+        public var selectedColor:uint = 0x00FF00;
+        public var downColor:uint = 0x0000FF;
+
+        public function get data():Object
+        {
+            return text;
+        }
+        public function set data(value:Object):void
+        {
+            text = String(value);
+        }
+        
+        private var _index:int;
+        
+        public function get index():int
+        {
+            return _index;
+        }
+        public function set index(value:int):void
+        {
+            _index = value;
+        }
+        
+        private var _hovered:Boolean;
+        
+        public function get hovered():Boolean
+        {
+            return _hovered;
+        }
+        public function set hovered(value:Boolean):void
+        {
+            _hovered = value;
+            updateRenderer();
+        }
+        
+        private var _selected:Boolean;
+        
+        public function get selected():Boolean
+        {
+            return _selected;
+        }
+        public function set selected(value:Boolean):void
+        {
+            _selected = value;
+            updateRenderer();
+        }
+
+        private var _down:Boolean;
+        
+        public function get down():Boolean
+        {
+            return _down;
+        }
+        public function set down(value:Boolean):void
+        {
+            _down = value;
+            updateRenderer();
+        }
+        
+        public function updateRenderer():void
+        {
+            background = (down || selected || hovered);
+            if (down)
+                backgroundColor = downColor;
+            else if (hovered)
+                backgroundColor = highlightColor;
+            else if (selected)
+                backgroundColor = selectedColor;
+        }
+
+        // beads declared in MXML are added to the strand.
+        // from AS, just call addBead()
+        public var beads:Array;
+        
+        private var _beads:Vector.<IBead>;
+        public function addBead(bead:IBead):void
+        {
+            if (!_beads)
+                _beads = new Vector.<IBead>;
+            _beads.push(bead);
+            bead.strand = this;
+        }
+        
+        public function getBeadByType(classOrInterface:Class):IBead
+        {
+            for each (var bead:IBead in _beads)
+            {
+                if (bead is classOrInterface)
+                    return bead;
+            }
+            return null;
+        }
+        
+        public function removeBead(value:IBead):IBead	
+        {
+            var n:int = _beads.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var bead:IBead = _beads[i];
+                if (bead == value)
+                {
+                    _beads.splice(i, 1);
+                    return bead;
+                }
+            }
+            return null;
+        }
+    }
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/TextFieldItemRenderer.as
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message