flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [13/50] [abbrv] git commit: [flex-asjs] [refs/heads/dual] - Improves MDL Tabs and TabBar components.
Date Tue, 18 Apr 2017 06:17:37 GMT
Improves MDL Tabs and TabBar components.


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

Branch: refs/heads/dual
Commit: d36034b0a4f76d69f1e24c5962b36c868bd84cb9
Parents: 1f41c28
Author: Peter Ent <pent@apache.org>
Authored: Tue Apr 4 09:02:31 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Tue Apr 4 09:02:31 2017 -0400

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/TabBar.as |  79 ++-----------
 .../src/main/flex/org/apache/flex/mdl/Tabs.as   | 118 ++-----------------
 .../org/apache/flex/mdl/beads/views/TabsView.as |   8 +-
 3 files changed, 16 insertions(+), 189 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d36034b0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TabBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TabBar.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TabBar.as
index ec15b27..e5d04ac 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TabBar.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TabBar.as
@@ -18,18 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
-    import org.apache.flex.core.IChild;
-    import org.apache.flex.core.IChrome;
-    import org.apache.flex.core.IItemRenderer;
-    import org.apache.flex.core.IItemRendererParent;
-    import org.apache.flex.core.ILayoutHost;
-	import org.apache.flex.core.ILayoutView;
-    import org.apache.flex.core.ILayoutParent;
-    import org.apache.flex.core.IParentIUIBase;
-	import org.apache.flex.html.Group;
-	import org.apache.flex.events.ItemAddedEvent;
-	import org.apache.flex.events.ItemClickedEvent;
-	import org.apache.flex.events.ItemRemovedEvent;
+	import org.apache.flex.html.List;
     import org.apache.flex.mdl.beads.models.ITabModel;
 
     COMPILE::JS
@@ -57,7 +46,7 @@ package org.apache.flex.mdl
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.8
 	 */
-	public class TabBar extends Group implements IItemRendererParent, ILayoutParent, ILayoutHost,
ILayoutView, IChrome
+	public class TabBar extends org.apache.flex.html.List
 	{
 		/**
 		 *  constructor.
@@ -82,11 +71,11 @@ package org.apache.flex.mdl
          * @playerversion AIR 2.6
          * @productversion FlexJS 0.8
          */
-        public function get dataProvider():Object
+        override public function get dataProvider():Object
         {
             return ITabModel(model).dataProvider;
         }
-        public function set dataProvider(value:Object):void
+        override public function set dataProvider(value:Object):void
         {
             ITabModel(model).dataProvider = value;
         }
@@ -99,11 +88,11 @@ package org.apache.flex.mdl
          * @playerversion AIR 2.6
          * @productversion FlexJS 0.8
          */
-        public function get labelField():String
+        override public function get labelField():String
         {
             return ITabModel(model).labelField;
         }
-        public function set labelField(value:String):void
+        override public function set labelField(value:String):void
         {
             ITabModel(model).labelField = value;
         }
@@ -126,64 +115,10 @@ package org.apache.flex.mdl
             ITabModel(model).tabIdField = value;
         }
 
-        public function set selectedIndex(value:int):void
+        override public function set selectedIndex(value:int):void
         {
             ITabModel(model).selectedIndex = value;
         }
-
-        override public function getLayoutHost():ILayoutHost
-        {
-			// can probably eliminate this function now
-            return this;
-        }
-
-        public function get contentView():ILayoutView
-        {
-            return this;
-        }
-
-        public function getItemRendererForIndex(index:int):IItemRenderer
-        {
-            var child:IItemRenderer = getElementAt(index) as IItemRenderer;
-            return child;
-        }
-		
-		public function addItemRenderer(renderer:IItemRenderer):void
-		{
-			addElement(renderer, true);
-			
-			var newEvent:ItemAddedEvent = new ItemAddedEvent("itemAdded");
-			newEvent.item = renderer;
-			
-			dispatchEvent(newEvent);
-		}
-		
-		public function removeItemRenderer(renderer:IItemRenderer):void
-		{
-			removeElement(renderer, true);
-			
-			var newEvent:ItemRemovedEvent = new ItemRemovedEvent("itemRemoved");
-			newEvent.item = renderer;
-			
-			dispatchEvent(newEvent);
-		}
-
-        public function removeAllItemRenderers():void
-        {
-            while (numElements > 0) {
-                var child:IChild = getElementAt(0);
-                removeElement(child);
-            }
-        }
-
-        public function updateAllItemRenderers():void
-        {
-            //todo: IItemRenderer does not define update function but DataItemRenderer does
-            //for(var i:int = 0; i < numElements; i++) {
-            //	var child:IItemRenderer = getElementAt(i) as IItemRenderer;
-            //	child.update();
-            //}
-        }
 		
         /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d36034b0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
index a47f9af..6bab01e 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
@@ -18,17 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
-    import org.apache.flex.core.IChild;
-    import org.apache.flex.core.IItemRenderer;
-    import org.apache.flex.core.IItemRendererParent;
-    import org.apache.flex.core.ILayoutHost;
-	import org.apache.flex.core.ILayoutView;
-    import org.apache.flex.core.ILayoutParent;
-    import org.apache.flex.core.IParentIUIBase;
-	import org.apache.flex.html.Group;
-	import org.apache.flex.events.ItemAddedEvent;
-	import org.apache.flex.events.ItemClickedEvent;
-	import org.apache.flex.events.ItemRemovedEvent;
+	import org.apache.flex.html.List;
     import org.apache.flex.mdl.beads.models.ITabModel;
 
     COMPILE::JS
@@ -53,7 +43,7 @@ package org.apache.flex.mdl
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.8
 	 */
-	public class Tabs extends Group implements IItemRendererParent, ILayoutParent, ILayoutHost,
ILayoutView
+	public class Tabs extends org.apache.flex.html.List
 	{
 		/**
 		 *  constructor.
@@ -78,14 +68,14 @@ package org.apache.flex.mdl
          * @playerversion AIR 2.6
          * @productversion FlexJS 0.8
          */
-        public function get dataProvider():Object
+        override public function get dataProvider():Object
         {
             return ITabModel(model).dataProvider;
         }
         /**
          *  @private
          */
-        public function set dataProvider(value:Object):void
+        override public function set dataProvider(value:Object):void
         {
             ITabModel(model).dataProvider = value;
         }
@@ -118,14 +108,14 @@ package org.apache.flex.mdl
          * @playerversion AIR 2.6
          * @productversion FlexJS 0.8
          */
-        public function get labelField():String
+        override public function get labelField():String
         {
             return ITabModel(model).labelField;
         }
         /**
          *  @private
          */
-        public function set labelField(value:String):void
+        override public function set labelField(value:String):void
         {
             ITabModel(model).labelField = value;
         }
@@ -138,106 +128,12 @@ package org.apache.flex.mdl
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
          */
-        public function set selectedIndex(value:int):void
+        override public function set selectedIndex(value:int):void
         {
             ITabModel(model).selectedIndex = value;
         }
 
         /**
-         *  get layout host
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.8
-         */
-        override public function getLayoutHost():ILayoutHost
-        {
-			// can probably eliminate this function now
-            return this;
-        }
-
-        /**
-         *  get content view
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.8
-         */
-        public function get contentView():ILayoutView
-        {
-            return this;
-        }
-
-        /**
-         *  get item renderer for index
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.8
-         */
-        public function getItemRendererForIndex(index:int):IItemRenderer
-        {
-            var child:IItemRenderer = getElementAt(index) as IItemRenderer;
-            return child;
-        }
-		
-		public function addItemRenderer(renderer:IItemRenderer):void
-		{
-			addElement(renderer, true);
-			
-			var newEvent:ItemAddedEvent = new ItemAddedEvent("itemAdded");
-			newEvent.item = renderer;
-			
-			dispatchEvent(newEvent);
-		}
-		
-		public function removeItemRenderer(renderer:IItemRenderer):void
-		{
-			removeElement(renderer, true);
-			
-			var newEvent:ItemRemovedEvent = new ItemRemovedEvent("itemRemoved");
-			newEvent.item = renderer;
-			
-			dispatchEvent(newEvent);
-		}
-
-        /**
-         *  remove all elements
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.8
-         */
-        public function removeAllItemRenderers():void
-        {
-            while (numElements > 0) {
-                var child:IChild = getElementAt(0);
-                removeElement(child);
-            }
-        }
-
-        /**
-         *  update all item renderers
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.8
-         */
-        public function updateAllItemRenderers():void
-        {
-            //todo: IItemRenderer does not define update function but DataItemRenderer does
-            //for(var i:int = 0; i < numElements; i++) {
-            //	var child:IItemRenderer = getElementAt(i) as IItemRenderer;
-            //	child.update();
-            //}
-        }
-
-        /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          */
         COMPILE::JS

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d36034b0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as
index 741b0db..112ff7a 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as
@@ -95,7 +95,7 @@ package org.apache.flex.mdl.beads.views
 
             _tabBar.model = (value as IStrandWithModel).model;
 
-            if (isTabsDynamic())
+            if (!isTabsDynamic())
             {
                 _tabBar.addEventListener("itemsCreated", tabBarItemsCreatedHandler);
                 _tabBar.addBead(new TabsItemRendererFactoryForArrayListData());
@@ -124,11 +124,7 @@ package org.apache.flex.mdl.beads.views
 		 */
         override protected function completeSetup():void
         {
-            var tb:TabBar = (host as IContentViewHost).strandChildren.getElementAt(0) as
TabBar;
-            if (!tb)
-            {
-                (host as IContentViewHost).strandChildren.addElementAt(tabBar, 0);
-            }
+			(host as IContentViewHost).addElementAt(tabBar,0);
 
             selectTabBarPanel();
         }


Mime
View raw message