flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Zarzycki <piotrzarzyck...@gmail.com>
Subject Re: git commit: [flex-asjs] [refs/heads/feature/chart-work] - Updates to MDL.
Date Sat, 08 Apr 2017 06:03:17 GMT
Hi Peter,

I'm concerning about changes in DataProviderChangeNotifier.

Since it is no longer emits dataProviderChanged event it can break logic in
some apps which people are working on.

Some time ago when I've changed ArrayList and add itemAdded/removed etc.
events I've created separate bead [1] which handle those cases.

If those changes stay I will remove my bead, but with this changes we will
lost ability to refresh whole collections by users who using this bead and
waiting for dataProviderChanged.

[1]
https://github.com/apache/flex-asjs/blob/develop/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderAddRemoveNotifier.as

Piotr

On Fri, Apr 7, 2017, 23:23 <pent@apache.org> wrote:

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/feature/chart-work 02d4118f0 -> 448e9f8e3
>
>
> Updates to MDL.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/448e9f8e
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/448e9f8e
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/448e9f8e
>
> Branch: refs/heads/feature/chart-work
> Commit: 448e9f8e37c41bf296ea44b33a38adf5bdf10f00
> Parents: 02d4118
> Author: Peter Ent <pent@apache.org>
> Authored: Fri Apr 7 17:23:26 2017 -0400
> Committer: Peter Ent <pent@apache.org>
> Committed: Fri Apr 7 17:23:26 2017 -0400
>
> ----------------------------------------------------------------------
>  .../html/beads/DataProviderChangeNotifier.as    | 61 +++++++++++++++++---
>  .../TabsItemRendererFactoryForArrayListData.as  |  3 +-
>  .../org/apache/flex/mdl/beads/views/TabsView.as |  2 +-
>  .../src/main/resources/defaults.css             |  4 +-
>  4 files changed, 59 insertions(+), 11 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/448e9f8e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
> index a24810b..2d647c5 100644
> ---
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
> +++
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
> @@ -26,16 +26,48 @@ package org.apache.flex.html.beads
>         import org.apache.flex.core.UIBase;
>         import org.apache.flex.events.IEventDispatcher;
>         import org.apache.flex.events.Event;
> +       import org.apache.flex.events.CollectionEvent;
>         import org.apache.flex.collections.ArrayList;
>
>         /**
> +        * Dispatched when a new item has been added to the dataProvider
> being watched.
> +        *
> +        *  @langversion 3.0
> +        *  @playerversion Flash 10.2
> +        *  @playerversion AIR 2.6
> +        *  @productversion FlexJS 0.8
> +        */
> +       [Event(name="itemAdded",
> type="org.apache.flex.events.CollectionEvent")]
> +
> +       /**
> +        * Dispatched when an item has been removed from the dataProvider
> being watched.
> +        *
> +        *  @langversion 3.0
> +        *  @playerversion Flash 10.2
> +        *  @playerversion AIR 2.6
> +        *  @productversion FlexJS 0.8
> +        */
> +       [Event(name="itemRemved",
> type="org.apache.flex.events.CollectionEvent")]
> +
> +       /**
> +        * Dispatched when an item has updated in the dataProvider being
> watched.
> +        *
> +        *  @langversion 3.0
> +        *  @playerversion Flash 10.2
> +        *  @playerversion AIR 2.6
> +        *  @productversion FlexJS 0.8
> +        */
> +       [Event(name="itemUpdated",
> type="org.apache.flex.events.CollectionEvent")]
> +
> +       /**
>          *  The DataProviderChangeNotifier notifies listeners when a
> selection model's
> -        *  ArrayList dataProvider has changed.
> +        *  ArrayList dataProvider has changed. It does this by forwarding
> events on
> +        *  the dataProvider to the model associated with the strand.
>          *
>          *  @langversion 3.0
>          *  @playerversion Flash 10.2
>          *  @playerversion AIR 2.6
> -        *  @productversion FlexJS 0.0
> +        *  @productversion FlexJS 0.8
>          */
>         public class DataProviderChangeNotifier implements IBead, IDocument
>         {
> @@ -45,12 +77,15 @@ package org.apache.flex.html.beads
>                  *  @langversion 3.0
>                  *  @playerversion Flash 10.2
>                  *  @playerversion AIR 2.6
> -                *  @productversion FlexJS 0.0
> +                *  @productversion FlexJS 0.8
>                  */
>                 public function DataProviderChangeNotifier()
>                 {
>                 }
>
> +               /**
> +                * @private
> +                */
>                 protected var _dataProvider:ArrayList;
>
>                 private var _strand:IStrand;
> @@ -61,7 +96,7 @@ package org.apache.flex.html.beads
>                  *  @langversion 3.0
>                  *  @playerversion Flash 10.2
>                  *  @playerversion AIR 2.6
> -                *  @productversion FlexJS 0.0
> +                *  @productversion FlexJS 0.8
>                  */
>                 public function set strand(value:IStrand):void
>                 {
> @@ -76,6 +111,9 @@ package org.apache.flex.html.beads
>                         }
>                 }
>
> +               /**
> +                * @private
> +                */
>                 private function
> destinationChangedHandler(event:Event):void
>                 {
>                         if (_dataProvider == null) {
> @@ -169,8 +207,11 @@ package org.apache.flex.html.beads
>                  */
>                 private function handleItemAdded(event:Event):void
>                 {
> +                       var e:CollectionEvent = event as CollectionEvent;
>                         var selectionModel:ISelectionModel =
> _strand.getBeadByType(ISelectionModel) as ISelectionModel;
> -                       selectionModel.dispatchEvent(new
> Event("dataProviderChanged"));
> +
> +                       var newEvent:Event = e.cloneEvent() as Event;
> +                       selectionModel.dispatchEvent(newEvent);
>                 }
>
>                 /**
> @@ -178,8 +219,11 @@ package org.apache.flex.html.beads
>                  */
>                 private function handleItemRemoved(event:Event):void
>                 {
> +                       var e:CollectionEvent = event as CollectionEvent;
>                         var selectionModel:ISelectionModel =
> _strand.getBeadByType(ISelectionModel) as ISelectionModel;
> -                       selectionModel.dispatchEvent(new
> Event("dataProviderChanged"));
> +
> +                       var newEvent:Event = e.cloneEvent() as Event;
> +                       selectionModel.dispatchEvent(newEvent);
>                 }
>
>                 /**
> @@ -187,8 +231,11 @@ package org.apache.flex.html.beads
>                  */
>                 private function handleItemUpdated(event:Event):void
>                 {
> +                       var e:CollectionEvent = event as CollectionEvent;
>                         var selectionModel:ISelectionModel =
> _strand.getBeadByType(ISelectionModel) as ISelectionModel;
> -                       selectionModel.dispatchEvent(new
> Event("dataProviderChanged"));
> +
> +                       var newEvent:Event = e.cloneEvent() as Event;
> +                       selectionModel.dispatchEvent(newEvent);
>                 }
>         }
>  }
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/448e9f8e/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/TabsItemRendererFactoryForArrayListData.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/TabsItemRendererFactoryForArrayListData.as
> b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/TabsItemRendererFactoryForArrayListData.as
> index c0650b8..defa8e8 100644
> ---
> a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/TabsItemRendererFactoryForArrayListData.as
> +++
> b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/TabsItemRendererFactoryForArrayListData.as
> @@ -208,7 +208,8 @@ package org.apache.flex.mdl.beads
>              newEvent.itemRenderer = ir;
>              dispatchEvent(newEvent);
>
> -            IEventDispatcher(_strand).dispatchEvent(new
> Event("itemsCreated"));
> +            //??IEventDispatcher(_strand).dispatchEvent(new
> Event("itemsCreated"));
> +                       IEventDispatcher(_strand).dispatchEvent(new
> Event("itemAdded"));
>          }
>      }
>  }
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/448e9f8e/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 112ff7a..3516123 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
> @@ -98,7 +98,7 @@ package org.apache.flex.mdl.beads.views
>              if (!isTabsDynamic())
>              {
>                  _tabBar.addEventListener("itemsCreated",
> tabBarItemsCreatedHandler);
> -                _tabBar.addBead(new
> TabsItemRendererFactoryForArrayListData());
> +                               _tabBar.addEventListener("itemAdded",
> tabBarItemsCreatedHandler);
>              }
>          }
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/448e9f8e/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 eff039f..2c3709e 100644
> ---
> a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
> +++
> b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
> @@ -115,7 +115,7 @@ Tabs
>      IBeadView: ClassReference("org.apache.flex.mdl.beads.views.TabsView");
>      IBeadModel:
> ClassReference("org.apache.flex.mdl.beads.models.TabArrayModel");
>      IBeadLayout: ClassReference(null);
> -    IDataProviderItemRendererMapper:
> ClassReference("org.apache.flex.mdl.beads.TabsItemRendererFactoryForArrayData");
> +    IDataProviderItemRendererMapper:
> ClassReference("org.apache.flex.mdl.beads.TabsItemRendererFactoryForArrayListData");
>      IItemRendererClassFactory:
> ClassReference("org.apache.flex.core.ItemRendererClassFactory");
>      IItemRenderer:
> ClassReference("org.apache.flex.mdl.itemRenderers.TabBarPanelItemRenderer");
>  }
> @@ -125,7 +125,7 @@ TabBar
>      IBeadView:
> ClassReference("org.apache.flex.mdl.beads.views.TabBarView");
>      IBeadModel:
> ClassReference("org.apache.flex.mdl.beads.models.TabArrayModel");
>      IBeadLayout: ClassReference(null);
> -    IDataProviderItemRendererMapper:
> ClassReference("org.apache.flex.mdl.beads.TabsItemRendererFactoryForArrayData");
> +    IDataProviderItemRendererMapper:
> ClassReference("org.apache.flex.mdl.beads.TabsItemRendererFactoryForArrayListData");
>      IItemRendererClassFactory:
> ClassReference("org.apache.flex.core.ItemRendererClassFactory");
>      IItemRenderer:
> ClassReference("org.apache.flex.mdl.itemRenderers.TabBarButtonTabsItemRenderer");
>  }
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message