flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: git commit: [flex-asjs] [refs/heads/develop] - Added List to the Express framework; its dataProvider can be either Array or ArrayList and it will set up the correct beads to handle it.
Date Tue, 10 Jan 2017 14:22:43 GMT
Thanks. Should have been more careful.

Much appreciated.
Peter

On 1/10/17, 3:27 AM, "omuppi1@gmail.com on behalf of OmPrakash Muppirala"
<omuppi1@gmail.com on behalf of bigosmallm@gmail.com> wrote:

>I was having build issues, so I fixed it.
>
>Thanks,
>Om
>
>On Mon, Jan 9, 2017 at 4:42 PM, Peter Ent <pent@adobe.com> wrote:
>
>> Oops. First time in awhile I forgot those. Will take care of it shortly.
>>
>> Peter
>>
>>
>> On Jan 9, 2017, at 5:49 PM, OmPrakash Muppirala <bigosmallm@gmail.com>
>> wrote:
>>
>> >>
>> >> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
>> >> d1b6c5d2/frameworks/projects/Express/src/main/flex/org/
>> >> apache/flex/express/List.as
>> >> 
>>----------------------------------------------------------------------
>> >> diff --git 
>>a/frameworks/projects/Express/src/main/flex/org/apache/flex/
>> express/List.as
>> >> b/frameworks/projects/Express/src/main/flex/org/apache/flex/
>> >> express/List.as
>> >> new file mode 100644
>> >> index 0000000..258ae77
>> >> --- /dev/null
>> >> +++ b/frameworks/projects/Express/src/main/flex/org/apache/flex/
>> >> express/List.as
>> >> @@ -0,0 +1,64 @@
>> >> +package org.apache.flex.express
>> >> +{
>> >> +       import org.apache.flex.collections.ArrayList;
>> >> +       import org.apache.flex.core.IBead;
>> >> +       import org.apache.flex.events.Event;
>> >> +       import org.apache.flex.html.List;
>> >> +       import org.apache.flex.html.beads.
>> DataItemRendererFactoryForArra
>> >> yData;
>> >> +       import org.apache.flex.html.beads.
>> DataItemRendererFactoryForArra
>> >> yList;
>> >> +       import org.apache.flex.html.beads.models.
>> ArrayListSelectionModel;
>> >> +       import org.apache.flex.html.beads.models.ArraySelectionModel;
>> >> +
>> >> +       public class List extends org.apache.flex.html.List
>> >> +       {
>> >> +               public function List()
>> >> +               {
>> >> +                       super();
>> >> +               }
>> >> +
>> >> +               override public function set
>>dataProvider(value:Object):
>> >> void
>> >> +               {
>> >> +                       if (value is Array) {
>> >> +                               // see if ArrayList beads are present
>> and
>> >> if so, remove them.
>> >> +                               // see if Array beads are present
>>and if
>> >> not, add them.
>> >> +
>> >> +                               if (model != null) {
>> >> +                                       removeBead(model as IBead);
>> >> +                               }
>> >> +                               var newModel:ArraySelectionModel =
>>new
>> >> ArraySelectionModel();
>> >> +                               addBead(newModel);
>> >> +
>> >> +                               var oldFactory1:Object =
>>getBeadByType(
>> >> DataItemRendererFactoryForArrayList);
>> >> +                               if (oldFactory1 != null) {
>> >> +                                       removeBead(oldFactory1 as
>> IBead);
>> >> +                               }
>> >> +                               var newFactory1:
>> >> DataItemRendererFactoryForArrayData = new
>> DataItemRendererFactoryForArra
>> >> yData();
>> >> +                               addBead(newFactory1);
>> >> +                       }
>> >> +                       else if (value is ArrayList) {
>> >> +                               // see if Array beads are present
>>and if
>> >> so, remove them.
>> >> +                               // see if ArrayList beads are present
>> and
>> >> if not, add them.
>> >> +
>> >> +                               if (model != null) {
>> >> +                                       removeBead(model as IBead);
>> >> +                               }
>> >> +                               var newListModel:
>> ArrayListSelectionModel
>> >> = new ArrayListSelectionModel();
>> >> +                               addBead(newListModel);
>> >> +
>> >> +                               var oldFactory2:Object =
>>getBeadByType(
>> >> DataItemRendererFactoryForArrayData);
>> >> +                               if (oldFactory2 != null) {
>> >> +                                       removeBead(oldFactory2 as
>> IBead);
>> >> +                               }
>> >> +                               var newFactory2:
>> >> DataItemRendererFactoryForArrayList = new
>> DataItemRendererFactoryForArra
>> >> yList();
>> >> +                               addBead(newFactory2);
>> >> +                       }
>> >> +
>> >> +                       super.dataProvider = value;
>> >> +
>> >> +                       // since the model and factory were pushed
>> >> programmatically onto the strand after the original
>> >> +                       // cycle of beads, generated an artifical
>> >> "beadsAdded" to let these new beads it is OK to continue
>> >> +                       // the start-up process.
>> >> +                       dispatchEvent(new Event("beadsAdded"));
>> >> +               }
>> >> +       }
>> >> +}
>> >> \ No newline at end of file
>> >>
>> >
>> >
>> > Looks like this file is missing license headers.  This broke the maven
>> > build.
>> >
>> > Thanks,
>> > Om
>>


Mime
View raw message