This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 30a8d81  jewel-datacontainerbase: needed to implement 
IClassSelectorListSupport
30a8d81 is described below

commit 30a8d817eaee9671cc5d41b8cdfa2c0998966dd9
Author: Carlos Rovira <[email protected]>
AuthorDate: Sat Mar 23 19:42:15 2019 +0100

    jewel-datacontainerbase: needed to implement IClassSelectorListSupport
---
 .../projects/Jewel/src/main/royale/JewelClasses.as |   1 +
 .../org/apache/royale/jewel/DataContainer.as       | 102 +---------------
 .../royale/org/apache/royale/jewel/DropDownList.as |  62 ++--------
 .../main/royale/org/apache/royale/jewel/Label.as   |   4 +-
 .../main/royale/org/apache/royale/jewel/List.as    |  14 +--
 .../main/royale/org/apache/royale/jewel/Table.as   | 104 +---------------
 .../jewel/supportClasses/DataContainerBase.as      | 132 +++++++++++++++++++++
 7 files changed, 163 insertions(+), 256 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as 
b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index e9a0233..4899278 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -98,6 +98,7 @@ package
         import org.apache.royale.jewel.supportClasses.ISelectableContent; 
ISelectableContent;
         import org.apache.royale.jewel.supportClasses.textinput.ITextInput; 
ITextInput;
 
+        import org.apache.royale.jewel.supportClasses.DataContainerBase; 
DataContainerBase;
         import org.apache.royale.jewel.supportClasses.Viewport; Viewport;
         import org.apache.royale.jewel.supportClasses.NoViewport; NoViewport;
         import 
org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport; 
ScrollingViewport;
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataContainer.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataContainer.as
index 96f6e2a..f3684f9 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataContainer.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataContainer.as
@@ -18,16 +18,12 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-       import org.apache.royale.core.DataContainerBase;
-       
-       import org.apache.royale.core.IDataProviderItemRendererMapper;
-       import org.apache.royale.core.IItemRenderer;
-    import org.apache.royale.core.IListWithPresentationModel;
-       import org.apache.royale.core.IListPresentationModel;
        import org.apache.royale.core.IDataProviderModel;
+       import org.apache.royale.core.IListPresentationModel;
+       import org.apache.royale.core.IListWithPresentationModel;
        import org.apache.royale.jewel.beads.models.ListPresentationModel;
-       import org.apache.royale.utils.ClassSelectorList;
-    import org.apache.royale.utils.IClassSelectorListSupport;
+       import org.apache.royale.jewel.supportClasses.DataContainerBase;
+       import org.apache.royale.utils.IClassSelectorListSupport;
 
        /**
         *  Indicates that the initialization of the list is complete.
@@ -69,98 +65,8 @@ package org.apache.royale.jewel
                {
                        super();
             typeNames = "jewel datacontainer";
-                       classSelectorList = new ClassSelectorList(this);
                }
 
-               protected var classSelectorList:ClassSelectorList;
-
-        COMPILE::JS
-        override protected function setClassName(value:String):void
-        {
-            classSelectorList.addNames(value);
-        }
-
-               /**
-         * Add a class selector to the list.
-         * 
-         * @param name Name of selector to add.
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function addClass(name:String):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.add(name);
-            }
-        }
-
-        /**
-         * Removes a class selector from the list.
-         * 
-         * @param name Name of selector to remove.
-         *
-         * @royaleignorecoercion HTMLElement
-         * @royaleignorecoercion DOMTokenList
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function removeClass(name:String):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.remove(name);
-            }
-        }
-
-        /**
-         * Add or remove a class selector to/from the list.
-         * 
-         * @param name Name of selector to add or remove.
-         * @param value True to add, False to remove.
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function toggleClass(name:String, value:Boolean):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.toggle(name, value);
-            }
-        }
-
-        /**
-                *  Search for the name in the element class list 
-                *
-         *  @param name Name of selector to find.
-         *  @return return true if the name is found or false otherwise.
-         * 
-                *  @langversion 3.0
-                *  @playerversion Flash 10.2
-                *  @playerversion AIR 2.6
-                *  @productversion Royale 0.9.4
-                */
-               public function containsClass(name:String):Boolean
-        {
-            COMPILE::JS
-            {
-            return classSelectorList.contains(name);
-            }
-            COMPILE::SWF
-            {//not implemented
-            return false;
-            }
-        }
-
                /**
                 *  The name of field within the data used for display. Each 
item of the
                 *  data should have a property with this name.
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DropDownList.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DropDownList.as
index 6e403c1..ee96cb8 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DropDownList.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DropDownList.as
@@ -18,22 +18,21 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-    import org.apache.royale.core.ISelectionModel;
+    COMPILE::JS
+    {
+    import goog.events;
+
+    import org.apache.royale.core.WrappedHTMLElement;
+    import org.apache.royale.html.util.addElementToWrapper;
+    import org.apache.royale.jewel.beads.models.IDropDownListModel;
+    }
     import org.apache.royale.core.IDataProviderModel;
-    import org.apache.royale.core.DataContainerBase;
     import org.apache.royale.core.IListPresentationModel;
-    import org.apache.royale.jewel.beads.models.IDropDownListModel;
-    import org.apache.royale.jewel.beads.models.ListPresentationModel;
+    import org.apache.royale.core.ISelectionModel;
     import org.apache.royale.html.elements.Select;
-    import org.apache.royale.events.IEventDispatcher;
-    import org.apache.royale.events.Event;
+    import org.apache.royale.jewel.beads.models.ListPresentationModel;
+    import org.apache.royale.jewel.supportClasses.DataContainerBase;
 
-    COMPILE::JS
-    {
-        import goog.events;
-        import org.apache.royale.core.WrappedHTMLElement;
-        import org.apache.royale.html.util.addElementToWrapper;
-    }
 
     //--------------------------------------
     //  Events
@@ -142,45 +141,6 @@ package org.apache.royale.jewel
             IDataProviderModel(model).dataProvider = value;
         }
 
-        /**
-         *  @private
-         *  @royaleignorecoercion HTMLOptionElement
-         *  @royaleignorecoercion HTMLSelectElement
-         *  @royaleignorecoercion org.apache.royale.core.ISelectionModel
-         */
-        // public function set dataProvider(value:Object):void
-        // {
-        //     ISelectionModel(model).dataProvider = value;
-        //     COMPILE::JS
-        //     {
-        //         var dp:HTMLOptionsCollection;
-        //         var i:int;
-        //         var n:int;
-        //         var opt:HTMLOptionElement;
-        //         var dd:HTMLSelectElement = element as HTMLSelectElement;
-
-        //         dp = dd.options;
-        //         n = dp.length;
-        //         for (i = 0; i < n; i++) {
-        //             dd.remove(0);
-        //         }
-        //         // The value could be undefined if data binding is used and 
the variable is not initialized.
-        //         if(!value)return;
-
-        //         var lf:String = labelField;
-        //         n = value.length;
-        //         for (i = 0; i < n; i++) {
-        //             opt = document.createElement('option') as 
HTMLOptionElement;
-        //             if (lf)
-        //                 opt.text = value[i][lf];
-        //             else
-        //                 opt.text = value[i];
-        //             dd.add(opt, null);
-        //         }
-
-        //     }
-        // }
-
         [Bindable("selectionChanged")]
         /**
          *  The index of the currently selected item. Changing this value
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Label.as 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Label.as
index 19531f3..a69522e 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Label.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Label.as
@@ -20,8 +20,8 @@ package org.apache.royale.jewel
 {
     COMPILE::JS
     {
-        import org.apache.royale.core.WrappedHTMLElement;
-        import org.apache.royale.html.util.addElementToWrapper;
+    import org.apache.royale.core.WrappedHTMLElement;
+    import org.apache.royale.html.util.addElementToWrapper;
     }
        import org.apache.royale.core.ITextModel;
        import org.apache.royale.core.StyledUIBase;
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/List.as 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/List.as
index aa0e0d3..afe06b1 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/List.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/List.as
@@ -18,17 +18,17 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-       import org.apache.royale.core.IRollOverModel;
-       import org.apache.royale.core.ISelectionModel;
-    import org.apache.royale.core.DataContainerBase;
+       COMPILE::JS
+       {
+       import org.apache.royale.core.WrappedHTMLElement;
+       }
        import org.apache.royale.core.IDataProviderModel;
        import org.apache.royale.core.IListPresentationModel;
+       import org.apache.royale.core.IRollOverModel;
+       import org.apache.royale.core.ISelectionModel;
        import org.apache.royale.jewel.beads.models.ListPresentationModel;
+       import org.apache.royale.jewel.supportClasses.DataContainerBase;
 
-       COMPILE::JS
-       {
-               import org.apache.royale.core.WrappedHTMLElement;
-       }
 
        /**
         *  Indicates that the initialization of the list is complete.
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Table.as 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Table.as
index f2e54ab..f70f94a 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Table.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Table.as
@@ -19,18 +19,16 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-       import org.apache.royale.core.DataContainerBase;
+       COMPILE::JS
+    {
+       import org.apache.royale.core.WrappedHTMLElement;
+       import org.apache.royale.html.util.addElementToWrapper;
+    }
        import org.apache.royale.core.ISelectionModel;
-       import org.apache.royale.events.Event;
        import org.apache.royale.jewel.beads.models.TableModel;
-       import org.apache.royale.utils.ClassSelectorList;
+       import org.apache.royale.jewel.supportClasses.DataContainerBase;
        import org.apache.royale.utils.IClassSelectorListSupport;
 
-       COMPILE::JS
-    {
-        import org.apache.royale.core.WrappedHTMLElement;
-               import org.apache.royale.html.util.addElementToWrapper;
-    }
        
        [DefaultProperty("columns")]
 
@@ -85,17 +83,8 @@ package org.apache.royale.jewel
                        super();
                        
                        typeNames = "jewel table";
-                       classSelectorList = new ClassSelectorList(this);
                }
 
-               protected var classSelectorList:ClassSelectorList;
-
-        COMPILE::JS
-        override protected function setClassName(value:String):void
-        {
-            classSelectorList.addNames(value);
-        }
-
                /**
                 *  The list of TableColumn objects displayed by this table. 
                 *  Each column selects different data provider item properties 
to display.
@@ -257,86 +246,5 @@ package org.apache.royale.jewel
         {
             return addElementToWrapper(this, 'table');
         }
-
-               /**
-         * Add a class selector to the list.
-         * 
-         * @param name Name of selector to add.
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function addClass(name:String):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.add(name);
-            }
-        }
-
-        /**
-         * Removes a class selector from the list.
-         * 
-         * @param name Name of selector to remove.
-         *
-         * @royaleignorecoercion HTMLElement
-         * @royaleignorecoercion DOMTokenList
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function removeClass(name:String):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.remove(name);
-            }
-        }
-
-        /**
-         * Add or remove a class selector to/from the list.
-         * 
-         * @param name Name of selector to add or remove.
-         * @param value True to add, False to remove.
-         * 
-         * @langversion 3.0
-         * @playerversion Flash 10.2
-         * @playerversion AIR 2.6
-         * @productversion Royale 0.9.4
-         */
-        public function toggleClass(name:String, value:Boolean):void
-        {
-            COMPILE::JS
-            {
-            classSelectorList.toggle(name, value);
-            }
-        }
-
-        /**
-                *  Search for the name in the element class list 
-                *
-         *  @param name Name of selector to find.
-         *  @return return true if the name is found or false otherwise.
-         * 
-                *  @langversion 3.0
-                *  @playerversion Flash 10.2
-                *  @playerversion AIR 2.6
-                *  @productversion Royale 0.9.4
-                */
-               public function containsClass(name:String):Boolean
-        {
-            COMPILE::JS
-            {
-            return classSelectorList.contains(name);
-            }
-            COMPILE::SWF
-            {//not implemented
-            return false;
-            }
-        }
     }
 }
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/DataContainerBase.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/DataContainerBase.as
new file mode 100644
index 0000000..93a6ab1
--- /dev/null
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/DataContainerBase.as
@@ -0,0 +1,132 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel.supportClasses
+{
+    import org.apache.royale.core.DataContainerBase;
+    import org.apache.royale.utils.IClassSelectorListSupport;
+    import org.apache.royale.utils.ClassSelectorList;
+
+    public class DataContainerBase extends 
org.apache.royale.core.DataContainerBase implements IClassSelectorListSupport
+    {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function DataContainerBase()
+               {
+            classSelectorList = new ClassSelectorList(this);
+                       super();
+               }
+
+        protected var classSelectorList:ClassSelectorList;
+
+        COMPILE::JS
+        override protected function setClassName(value:String):void
+        {
+            classSelectorList.addNames(value);
+        }
+
+        /**
+         * Add a class selector to the list.
+         * 
+         * @param name Name of selector to add.
+         * 
+         * @langversion 3.0
+         * @playerversion Flash 10.2
+         * @playerversion AIR 2.6
+         * @productversion Royale 0.9.3
+         */
+        public function addClass(name:String):void
+        {
+            COMPILE::JS
+            {
+            classSelectorList.add(name);
+            }
+        }
+
+        /**
+         * Removes a class selector from the list.
+         * 
+         * @param name Name of selector to remove.
+         *
+         * @royaleignorecoercion HTMLElement
+         * @royaleignorecoercion DOMTokenList
+         * 
+         * @langversion 3.0
+         * @playerversion Flash 10.2
+         * @playerversion AIR 2.6
+         * @productversion Royale 0.9.3
+         */
+        public function removeClass(name:String):void
+        {
+            COMPILE::JS
+            {
+            classSelectorList.remove(name);
+            }
+        }
+
+        /**
+         * Add or remove a class selector to/from the list.
+         * 
+         * @param name Name of selector to add or remove.
+         * @param value True to add, False to remove.
+         * 
+         * @langversion 3.0
+         * @playerversion Flash 10.2
+         * @playerversion AIR 2.6
+         * @productversion Royale 0.9.3
+         */
+        public function toggleClass(name:String, value:Boolean):void
+        {
+            COMPILE::JS
+            {
+            classSelectorList.toggle(name, value);
+            }
+        }
+
+        /**
+                *  Search for the name in the element class list 
+                *
+         *  @param name Name of selector to find.
+         *  @return return true if the name is found or false otherwise.
+         * 
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+               public function containsClass(name:String):Boolean
+        {
+            COMPILE::JS
+            {
+            return classSelectorList.contains(name);    
+            }
+            COMPILE::SWF
+            {//not implemented
+            return false;
+            }
+        }
+
+    }
+
+}
\ No newline at end of file

Reply via email to