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

aharui 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 b8fbdc4  move MXML support into UIComponent.  Should fix #516
b8fbdc4 is described below

commit b8fbdc40d30cdfcd02766b1255b5e0c852ee667c
Author: Alex Harui <[email protected]>
AuthorDate: Mon Oct 21 23:12:36 2019 -0700

    move MXML support into UIComponent.  Should fix #516
---
 .../MXRoyale/src/main/royale/mx/core/Container.as  | 62 +---------------------
 .../src/main/royale/mx/core/UIComponent.as         | 55 +++++++++++++++++++
 .../royale/spark/components/SkinnableContainer.as  | 49 +----------------
 .../spark/components/supportClasses/GroupBase.as   | 52 +-----------------
 4 files changed, 59 insertions(+), 159 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
index 12201f5..c4965fa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -40,7 +40,6 @@ package mx.core
     import org.apache.royale.events.ValueChangeEvent;
     import org.apache.royale.events.ValueEvent;
     import org.apache.royale.states.State;
-    import org.apache.royale.utils.MXMLDataInterpreter;
     import org.apache.royale.utils.loadBeadFromValuesManager;
 
 COMPILE::JS
@@ -771,8 +770,6 @@ public class Container extends UIComponent
        //
        
//--------------------------------------------------------------------------
        
-       private var _mxmlDescriptor:Array;
-       
        override public function addedToParent():void
        {
                if (!initialized) {
@@ -792,8 +789,8 @@ public class Container extends UIComponent
        
     override protected function createChildren():void
     {
-        MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, 
MXMLDescriptor);
-
+        super.createChildren();
+        
         if (getBeadByType(DataBindingBase) == null)
             addBead(new ContainerDataBinding());
 
@@ -816,61 +813,6 @@ public class Container extends UIComponent
         }
     }
     
-    override public function get mxmlDocument():Object
-    {
-        if (!_mxmlDocument && MXMLDescriptor != null)
-            _mxmlDocument = this;
-        return _mxmlDocument;
-    }
-    
-       /**
-        *  @copy org.apache.royale.core.Application#MXMLDescriptor
-        *  
-        *  @langversion 3.0
-        *  @playerversion Flash 10.2
-        *  @playerversion AIR 2.6
-        *  @productversion Royale 0.8
-        */
-       public function get MXMLDescriptor():Array
-       {
-               return _mxmlDescriptor;
-       }
-       
-       /**
-        *  @private
-        */
-       public function setMXMLDescriptor(document:Object, value:Array):void
-       {
-               _mxmlDocument = document;
-               _mxmlDescriptor = value;
-       }
-       
-       /**
-        *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
-        *  
-        *  @langversion 3.0
-        *  @playerversion Flash 10.2
-        *  @playerversion AIR 2.6
-        *  @productversion Royale 0.8
-        */
-       public function generateMXMLAttributes(data:Array):void
-       {
-        if (!_mxmlDocument)
-            _mxmlDocument = this;
-               MXMLDataInterpreter.generateMXMLProperties(this, data);
-       }
-       
-       /**
-        *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
-        *  
-        *  @langversion 3.0
-        *  @playerversion Flash 10.2
-        *  @playerversion AIR 2.6
-        *  @productversion Royale 0.8
-        * 
-        *  @royalesuppresspublicvarwarning
-        */
-       public var mxmlContent:Array;
        
        /*
        * IContainer
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index db8ef4a..1da127f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -63,6 +63,7 @@ import mx.styles.IStyleClient;
 import mx.styles.IStyleManager2;
 import mx.styles.StyleManager;
 import mx.utils.StringUtil;
+import org.apache.royale.utils.MXMLDataInterpreter;
 use namespace mx_internal;
 
 import org.apache.royale.core.CallLaterBead;
@@ -89,6 +90,7 @@ import org.apache.royale.utils.loadBeadFromValuesManager;
 import mx.validators.IValidatorListener;
 import mx.validators.ValidationResult;
 import mx.events.ValidationResultEvent;
+import org.apache.royale.utils.MXMLDataInterpreter;
 
 /**
  *  Set a different class for click events so that
@@ -1864,6 +1866,8 @@ COMPILE::JS
      */
     public function get mxmlDocument():Object
     {
+        if (!_mxmlDocument && MXMLDescriptor != null)
+            _mxmlDocument = this;
         return _mxmlDocument;
     }
     
@@ -3626,8 +3630,59 @@ COMPILE::JS
      */
     protected function createChildren():void
     {
+        MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, 
MXMLDescriptor);
     }
     
+    private var _mxmlDescriptor:Array;
+    
+    /**
+     *  @copy org.apache.royale.core.Application#MXMLDescriptor
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     */
+    public function get MXMLDescriptor():Array
+    {
+        return _mxmlDescriptor;
+    }
+    
+    /**
+     *  @private
+     */
+    public function setMXMLDescriptor(document:Object, value:Array):void
+    {
+        _mxmlDocument = document;
+        _mxmlDescriptor = value;
+    }
+    
+    /**
+     *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     */
+    public function generateMXMLAttributes(data:Array):void
+    {
+        if (!_mxmlDocument)
+            _mxmlDocument = this;
+        MXMLDataInterpreter.generateMXMLProperties(this, data);
+    }
+    
+    /**
+     *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     * 
+     *  @royalesuppresspublicvarwarning
+     */
+    public var mxmlContent:Array;
 
     
//--------------------------------------------------------------------------
     //
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
index ed771f5..590a135 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
@@ -728,18 +728,6 @@ public class SkinnableContainer extends SkinnableComponent 
implements IContainer
     }
      */
      
-     /**
-      *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
-      *  
-      *  @langversion 3.0
-      *  @playerversion Flash 10.2
-      *  @playerversion AIR 2.6
-      *  @productversion Royale 0.8
-      * 
-      *  @royalesuppresspublicvarwarning
-      */
-     public var mxmlContent:Array;
-
     /**
      *  override setting of children
      */
@@ -902,41 +890,6 @@ public class SkinnableContainer extends SkinnableComponent 
implements IContainer
         currentContentGroup.removeAllElements(); */
     } 
     
-    /**
-     *  @copy org.apache.royale.core.Application#MXMLDescriptor
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
-     */
-    public function get MXMLDescriptor():Array
-    {
-        return _mxmlDescriptor;
-    }
-    
-    /**
-     *  @private
-     */
-    public function setMXMLDescriptor(document:Object, value:Array):void
-    {
-        _mxmlDocument = document;
-        _mxmlDescriptor = value;
-    }
-    
-    /**
-     *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
-     */
-    public function generateMXMLAttributes(data:Array):void
-    {
-        MXMLDataInterpreter.generateMXMLProperties(this, data);
-    }
-    
     /*
     * IContainer
     */
@@ -1026,7 +979,7 @@ public class SkinnableContainer extends SkinnableComponent 
implements IContainer
     
     override protected function createChildren():void
     {
-        MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, 
MXMLDescriptor);
+        super.createChildren();
         
         if (getBeadByType(DataBindingBase) == null)
             addBead(new ContainerDataBinding());
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as
index 2d3b3bb..f14efdd 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as
@@ -1217,7 +1217,7 @@ public class GroupBase extends UIComponent implements 
ILayoutParent, IContainer
         if (!layout)
             layout = new BasicLayout();
         
-        MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, 
MXMLDescriptor);
+        super.createChildren();
         
         if (getBeadByType(DataBindingBase) == null)
             addBead(new ContainerDataBinding());
@@ -1225,56 +1225,6 @@ public class GroupBase extends UIComponent implements 
ILayoutParent, IContainer
         dispatchEvent(new Event("initBindings"));
     }
 
-    private var _mxmlDescriptor:Array;
-    private var _mxmlDocument:Object = this;
-
-    /**
-     *  @copy org.apache.royale.core.Application#MXMLDescriptor
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
-     */
-    public function get MXMLDescriptor():Array
-    {
-        return _mxmlDescriptor;
-    }
-    
-    /**
-     *  @private
-     */
-    public function setMXMLDescriptor(document:Object, value:Array):void
-    {
-        _mxmlDocument = document;
-        _mxmlDescriptor = value;
-    }
-    
-    /**
-     *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
-     */
-    public function generateMXMLAttributes(data:Array):void
-    {
-        MXMLDataInterpreter.generateMXMLProperties(this, data);
-    }
-    
-    /**
-     *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
-     * 
-     *  @royalesuppresspublicvarwarning
-     */
-    public var mxmlContent:Array;
-    
     /**
      *  @private
      */ 

Reply via email to