flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Remove redundant ItemRendererFactoryForArrayData - change it to org.apache.flex.html.beads.DataItemRendererFactoryForArrayData
Date Tue, 03 Jan 2017 12:45:56 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop d6dec081d -> 6642ca7d4


Remove redundant ItemRendererFactoryForArrayData - change it to org.apache.flex.html.beads.DataItemRendererFactoryForArrayData


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

Branch: refs/heads/develop
Commit: 6642ca7d4387fa1308a4ba5f834b03118e1c8efb
Parents: d6dec08
Author: piotrz <piotrz@apache.org>
Authored: Tue Jan 3 13:45:51 2017 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Tue Jan 3 13:45:51 2017 +0100

----------------------------------------------------------------------
 .../ItemRendererFactoryForArrayData.as          | 177 -------------------
 .../src/main/resources/defaults.css             |   4 +-
 .../src/main/resources/mdl-manifest.xml         |   1 -
 3 files changed, 2 insertions(+), 180 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6642ca7d/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
deleted file mode 100644
index e96af4b..0000000
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
+++ /dev/null
@@ -1,177 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.mdl.supportClasses
-{
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IDataProviderItemRendererMapper;
-	import org.apache.flex.core.IItemRendererClassFactory;
-	import org.apache.flex.core.IItemRendererParent;
-	import org.apache.flex.core.IListPresentationModel;
-	import org.apache.flex.core.ISelectableItemRenderer;
-	import org.apache.flex.core.ISelectionModel;
-	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.SimpleCSSStyles;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.ValuesManager;
-	import org.apache.flex.events.Event;
-	import org.apache.flex.events.EventDispatcher;
-	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.events.ItemRendererEvent;
-	import org.apache.flex.html.beads.IListView;
-
-	[Event(name="itemRendererCreated",type="org.apache.flex.events.ItemRendererEvent")]
-
-    /**
-     *  The ItemRendererFactoryForArrayData class reads an
-     *  array of data and creates an item renderer for every
-     *  item in the array.  Other implementations of
-     *  IDataProviderItemRendererMapper map different data
-     *  structures or manage a virtual set of renderers.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-	public class ItemRendererFactoryForArrayData extends EventDispatcher implements IBead, IDataProviderItemRendererMapper
-	{
-        /**
-         *  Constructor.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function ItemRendererFactoryForArrayData(target:Object=null)
-		{
-			super(target);
-		}
-
-		private var selectionModel:ISelectionModel;
-
-		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;
-			IEventDispatcher(value).addEventListener("beadsAdded",finishSetup);
-			IEventDispatcher(value).addEventListener("initComplete",finishSetup);
-		}
-
-		private function finishSetup(event:Event):void
-		{
-			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
-			dataGroup = listView.dataGroup;
-			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
-			if (!itemRendererFactory)
-			{
-				_itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory"))
as IItemRendererClassFactory;
-				_strand.addBead(_itemRendererFactory);
-			}
-
-			dataProviderChangeHandler(null);
-		}
-
-		private var _itemRendererFactory:IItemRendererClassFactory;
-
-        /**
-         *  The org.apache.flex.core.IItemRendererClassFactory used
-         *  to generate instances of item renderers.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function get itemRendererFactory():IItemRendererClassFactory
-		{
-			return _itemRendererFactory;
-		}
-
-        /**
-         *  @private
-         */
-		public function set itemRendererFactory(value:IItemRendererClassFactory):void
-		{
-			_itemRendererFactory = value;
-		}
-
-        /**
-         *  The org.apache.flex.core.IItemRendererParent that will
-         *  parent the item renderers.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		protected var dataGroup:IItemRendererParent;
-
-		protected function dataProviderChangeHandler(event:Event):void
-		{
-			var dp:Array = selectionModel.dataProvider as Array;
-			if (!dp)
-				return;
-
-			dataGroup.removeAllElements();
-
-			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
-			var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel)
as IListPresentationModel;
-
-			// This needs to be re-thought. There should be a better way to move the
-			// properties from the component to the renderers. At least a new interface
-			// should be created.
-			var component:UIBase = _strand as UIBase;
-
-			var n:int = dp.length;
-			for (var i:int = 0; i < n; i++)
-			{
-				var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as
ISelectableItemRenderer;
-				dataGroup.addElement(ir);
-				ir.index = i;
-                ir.labelField = component["labelField"];
-				if (presentationModel) {
-					var style:SimpleCSSStyles = new SimpleCSSStyles();
-					style.marginBottom = presentationModel.separatorThickness;
-					UIBase(ir).style = style;
-					UIBase(ir).height = presentationModel.rowHeight;
-					UIBase(ir).percentWidth = 100;
-				}
-				ir.data = dp[i];
-
-				var newEvent:ItemRendererEvent = new ItemRendererEvent(ItemRendererEvent.CREATED);
-				newEvent.itemRenderer = ir;
-				dispatchEvent(newEvent);
-			}
-
-			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6642ca7d/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
index b8a13b0..1cf6a46 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
@@ -51,7 +51,7 @@ List
     IBeadView: ClassReference("org.apache.flex.mdl.beads.views.ListView");
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
     IBeadLayout: ClassReference(null); /*"org.apache.flex.html.beads.layouts.VerticalLayout"*/
-    IDataProviderItemRendererMapper: ClassReference("org.apache.flex.mdl.supportClasses.ItemRendererFactoryForArrayData");
+    IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
     IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
     IItemRenderer: ClassReference("org.apache.flex.mdl.itemRenderers.ListItemRenderer");
 }
@@ -61,7 +61,7 @@ Menu
     IBeadView: ClassReference("org.apache.flex.mdl.beads.views.ListView");
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
     IBeadLayout: ClassReference(null); /*"org.apache.flex.html.beads.layouts.VerticalLayout"*/
-    IDataProviderItemRendererMapper: ClassReference("org.apache.flex.mdl.supportClasses.ItemRendererFactoryForArrayData");
+    IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
     IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
     IItemRenderer: ClassReference("org.apache.flex.mdl.itemRenderers.MenuItemRenderer");
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6642ca7d/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
index b3d00cf..7bbbc32 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -55,7 +55,6 @@
     <component id="ListItemSubTitle" class="org.apache.flex.mdl.beads.ListItemSubTitle"/>
     <component id="ListItemSecondaryInfo" class="org.apache.flex.mdl.beads.ListItemSecondaryInfo"/>
     <component id="ListItemTextBody" class="org.apache.flex.mdl.beads.ListItemTextBody"/>
-    <component id="ItemRendererFactoryForArrayData" class="org.apache.flex.mdl.supportClasses.ItemRendererFactoryForArrayData"/>
     <component id="NavigationLayout" class="org.apache.flex.mdl.NavigationLayout"/>
     <component id="LayoutTitle" class="org.apache.flex.mdl.LayoutTitle"/>
     <component id="Navigation" class="org.apache.flex.mdl.Navigation"/>


Mime
View raw message