You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/09/28 03:42:40 UTC

[royale-asjs] branch develop updated (36152d9 -> 642e35c)

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

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


    from 36152d9  add ws to .gitignore
     new 738d58f  fix construction with XMLList literal.
     new 8cb40f0  if dataProvider changes, update the dataprovider in the column lists
     new 4da068a  SWF side also needs to dispatch itemMouseDown
     new bb56d8a  switch to using an interface
     new 1da49c2  allow overriding of what text is displayed
     new b41edf6  allow overriding of what text to display
     new d50ed88  handle ICollectionViews when creating renderers
     new 656f2e4  update ComboBoxModel to handle ICollectionView
     new 7f0a980  fix datagridcolumn labels
     new 04b91aa  add new classes to swc
     new f8586ae  use new classes as beads.  Also fix some Panel styling
     new 765c85c  SWF needed override
     new d4fded5  size to contentarea to content unless Panel is sized by parent
     new dc18a7a  fix header text
     new 3b32ee4  handle XML
     new 8084664  use ICollectionView
     new a260d71  listen for click instead of up, at least for now
     new 1939818  also layout content area when children added
     new 67c1a3a  adjust test script since click is currenly required in JS menus
     new 006bdf9  hide menus on selection
     new 642e35c  refactor popuphost to have a reference from the effective parent back to the popuphost.  this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent chain to walk.  Using systemmanager moves the popups out of the childlist in the application where the layouts try to run on the popup, which may not be a UIComponent (if it is a re-used UIBase from Basic).

The 21 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../royale/org/apache/royale/core/Application.as   | 10 +++-
 .../main/royale/org/apache/royale/core/ViewBase.as | 11 +++-
 .../org/apache/royale/html/beads/DataGridView.as   |  6 +++
 .../controllers/ItemRendererMouseController.as     |  7 +++
 .../beads/controllers/MenuBarMouseController.as    |  4 +-
 .../controllers/MenuSelectionMouseController.as    |  5 +-
 .../royale/html/beads/models/MenuBarModel.as       |  3 +-
 .../html/supportClasses/StringItemRenderer.as      |  8 ++-
 .../html/supportClasses/TextButtonItemRenderer.as  |  2 +-
 .../projects/Core/src/main/royale/CoreClasses.as   |  2 +
 .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
 .../core/{ITransformModel.as => IMenuBarModel.as}  | 15 +++---
 .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
 .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
 .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++--
 .../MXRoyale/src/main/resources/defaults.css       | 22 ++++++--
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |  3 ++
 .../royale/mx/collections/ListCollectionView.as    |  1 +
 .../src/main/royale/mx/containers/Panel.as         | 14 +++++
 .../main/royale/mx/containers/beads/PanelView.as   |  8 ++-
 .../src/main/royale/mx/controls/ComboBase.as       | 35 ++++++++++++
 .../mx/controls/beads/models/ComboBoxModel.as}     | 62 +++++++++++++++-------
 .../mx/controls/beads/models/MenuBarModel.as       | 27 +++++++++-
 .../TextButtonDataGridColumnItemRenderer.as}       | 27 +++++-----
 .../mx/controls/dataGridClasses/DataGridColumn.as  |  1 +
 ...taItemRendererFactoryForICollectionViewData.as} | 38 ++-----------
 .../royale/mx/controls/listClasses/ListBase.as     | 36 +++++++++++++
 .../mx/controls/listClasses/ListItemRenderer.as    | 14 ++++-
 .../src/main/royale/mx/core/Application.as         | 29 ++++++++--
 .../src/main/royale/mx/managers/SystemManager.as   | 53 ++++++++++++++++--
 frameworks/projects/XML/src/main/royale/XMLList.as | 37 +++++++++++--
 .../basicTests/halo/scripts/MenuBarTestScript.mxml |  3 ++
 32 files changed, 394 insertions(+), 124 deletions(-)
 copy frameworks/projects/Core/src/main/royale/org/apache/royale/core/{ITransformModel.as => IMenuBarModel.as} (74%)
 copy frameworks/projects/Core/src/main/royale/org/apache/royale/core/{IPopUpHost.as => IPopUpHostParent.as} (77%)
 copy frameworks/projects/{Core/src/main/royale/org/apache/royale/events/StyleChangeEvent.as => MXRoyale/src/main/royale/mx/controls/beads/models/ComboBoxModel.as} (55%)
 copy frameworks/projects/MXRoyale/src/main/royale/mx/{core/IFlexModule.as => controls/buttonBarClasses/TextButtonDataGridColumnItemRenderer.as} (69%)
 copy frameworks/projects/MXRoyale/src/main/royale/mx/controls/{treeClasses/DataItemRendererFactoryForICollectionViewHierarchicalData.as => listClasses/DataItemRendererFactoryForICollectionViewData.as} (79%)


[royale-asjs] 20/21: hide menus on selection

Posted by ah...@apache.org.
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

commit 006bdf9a292e80c6ee4790bd7e53fe55f95a82d1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 20:37:07 2018 -0700

    hide menus on selection
---
 .../apache/royale/html/beads/controllers/MenuSelectionMouseController.as | 1 +
 1 file changed, 1 insertion(+)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
index ad4ee3f..e130426 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
@@ -122,6 +122,7 @@ package org.apache.royale.html.beads.controllers
 			
 			list.model.selectedItem = node;
 			menuDispatcher.dispatchEvent(new Event("change"));
+            hideOpenMenus();
 		}
 		
 		/**


[royale-asjs] 13/21: size to contentarea to content unless Panel is sized by parent

Posted by ah...@apache.org.
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

commit d4fded5c66e0634f72fee8b5e1f10d53a88c4e2a
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:44:06 2018 -0700

    size to contentarea to content unless Panel is sized by parent
---
 .../MXRoyale/src/main/royale/mx/containers/beads/PanelView.as     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
index 84bac6c..5d169a2 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
@@ -29,6 +29,7 @@ import mx.containers.beads.models.PanelModel;
 import mx.core.ContainerLayout;
 
 import org.apache.royale.core.IBead;
+import org.apache.royale.core.ILayoutChild;
 import org.apache.royale.core.IStrand;
 import org.apache.royale.core.UIBase;
 import org.apache.royale.html.beads.PanelView;
@@ -97,8 +98,11 @@ public class PanelView extends org.apache.royale.html.beads.PanelView
     {
         titleBar.percentWidth = 100;
             
-        contentArea.percentWidth = 100;
-        contentArea.percentHeight = 100;
+        var panel:ILayoutChild = host as ILayoutChild;
+        if (!panel.isWidthSizedToContent())
+            contentArea.percentWidth = 100;
+        if (!panel.isHeightSizedToContent())
+            contentArea.percentHeight = 100;
         
         // Now give the Panel its own layout
         var boxLayout:BoxLayout = new BoxLayout();


[royale-asjs] 02/21: if dataProvider changes, update the dataprovider in the column lists

Posted by ah...@apache.org.
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

commit 8cb40f0c6e0deac0f151b5ed6aa603aac0236de1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:31:06 2018 -0700

    if dataProvider changes, update the dataprovider in the column lists
---
 .../src/main/royale/org/apache/royale/html/beads/DataGridView.as    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DataGridView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DataGridView.as
index 89689f0..2bce4a9 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DataGridView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DataGridView.as
@@ -158,6 +158,12 @@ package org.apache.royale.html.beads
 			 */
 			private function handleDataProviderChanged(event:Event):void
 			{
+                var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+                for (var i:int=0; i < _lists.length; i++)
+                {
+                    var list:IDataGridColumnList = _lists[i] as IDataGridColumnList;
+                    list.dataProvider = sharedModel.dataProvider;
+                }
 				host.dispatchEvent(new Event("layoutNeeded"));
 			}
 


[royale-asjs] 17/21: listen for click instead of up, at least for now

Posted by ah...@apache.org.
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

commit a260d711f62842a938cfc3fcbe4f0247e519baa3
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 12:26:07 2018 -0700

    listen for click instead of up, at least for now
---
 .../royale/html/beads/controllers/MenuSelectionMouseController.as     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
index 61e933c..ad4ee3f 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuSelectionMouseController.as
@@ -91,7 +91,7 @@ package org.apache.royale.html.beads.controllers
          */
 		override protected function handleItemAdded(event:ItemAddedEvent):void
 		{
-			IEventDispatcher(event.item).addEventListener("itemMouseUp", selectedHandler);
+			IEventDispatcher(event.item).addEventListener("itemClicked", selectedHandler);
 			IEventDispatcher(event.item).addEventListener("itemRollOver", rolloverHandler);
 			IEventDispatcher(event.item).addEventListener("itemRollOut", rolloutHandler);
 		}
@@ -101,7 +101,7 @@ package org.apache.royale.html.beads.controllers
          */
 		override protected function handleItemRemoved(event:ItemRemovedEvent):void
 		{
-			IEventDispatcher(event.item).removeEventListener("itemMouseUp", selectedHandler);
+			IEventDispatcher(event.item).removeEventListener("itemClicked", selectedHandler);
 			IEventDispatcher(event.item).removeEventListener("itemRollOver", rolloverHandler);
 			IEventDispatcher(event.item).removeEventListener("itemRollOut", rolloutHandler);
 		}


[royale-asjs] 04/21: switch to using an interface

Posted by ah...@apache.org.
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

commit bb56d8a544ec773e0f9445844ec34a1600d09963
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:35:31 2018 -0700

    switch to using an interface
---
 .../beads/controllers/MenuBarMouseController.as    |  4 +-
 .../royale/html/beads/models/MenuBarModel.as       |  3 +-
 .../projects/Core/src/main/royale/CoreClasses.as   |  2 +
 .../org/apache/royale/core/IMenuBarModel.as}       | 52 +++++-----------------
 .../mx/controls/beads/models/MenuBarModel.as       | 27 ++++++++++-
 5 files changed, 42 insertions(+), 46 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuBarMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuBarMouseController.as
index 70e06b1..e446f19 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuBarMouseController.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/MenuBarMouseController.as
@@ -31,7 +31,7 @@ package org.apache.royale.html.beads.controllers
 	import org.apache.royale.events.ItemClickedEvent;
 	import org.apache.royale.html.Menu;
 	import org.apache.royale.html.MenuBar;
-	import org.apache.royale.html.beads.models.MenuBarModel;
+	import org.apache.royale.core.IMenuBarModel;
 	import org.apache.royale.utils.UIUtils;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
 
@@ -114,7 +114,7 @@ package org.apache.royale.html.beads.controllers
 			var menuFactory:IFactory = loadBeadFromValuesManager(IFactory, "iMenuFactory", _strand) as IFactory;
 			var menu:IMenu = menuFactory.newInstance() as IMenu;
 			
-			var model:MenuBarModel = _strand.getBeadByType(IBeadModel) as MenuBarModel;
+			var model:IMenuBarModel = _strand.getBeadByType(IBeadModel) as IMenuBarModel;
 			
 			menu.dataProvider = event.data[model.submenuField];
 			menu.labelField = model.labelField;
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/MenuBarModel.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/MenuBarModel.as
index 7a51450..80ca593 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/MenuBarModel.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/models/MenuBarModel.as
@@ -14,13 +14,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.html.beads.models
 {
+    import org.apache.royale.core.IMenuBarModel;
 	import org.apache.royale.html.beads.models.ArraySelectionModel;
 	import org.apache.royale.events.Event;
 
 	/**
 	 * The model used by the MenuBar.
 	 */
-	public class MenuBarModel extends ArraySelectionModel
+	public class MenuBarModel extends ArraySelectionModel implements IMenuBarModel
 	{
 		public function MenuBarModel()
 		{
diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index 0928389..514c6a6 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -233,6 +233,8 @@ import org.apache.royale.events.ItemRemovedEvent; ItemRemovedEvent;
     import org.apache.royale.states.SetProperty; SetProperty;
     import org.apache.royale.states.State; State;
 
+    import org.apache.royale.core.IMenuBarModel; IMenuBarModel;
+    
     import org.apache.royale.core.IDataGridModel; IDataGridModel;
     import org.apache.royale.core.IDataGridPresentationModel; IDataGridPresentationModel;
     import org.apache.royale.core.IDateChooserModel; IDateChooserModel;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IMenuBarModel.as
similarity index 52%
copy from frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as
copy to frameworks/projects/Core/src/main/royale/org/apache/royale/core/IMenuBarModel.as
index 4df5cad..980bd51 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IMenuBarModel.as
@@ -16,63 +16,33 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package mx.controls.beads.models
+package org.apache.royale.core
 {
-    import mx.controls.MenuBar;
-    
-    import org.apache.royale.core.IMenu;
-    import org.apache.royale.core.IUIBase;
-    import org.apache.royale.html.beads.models.MenuBarModel;
+	import org.apache.royale.events.IEventDispatcher;
 	
     /**
-     *  MenuBar Mouse Controller
+     *  The IComboBoxModel interface describes the minimum set of properties
+     *  available to a ComboBox control.  More sophisticated ComboBox controls
+     *  could have models that extend IComboBoxModel.
      *  
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-	public class MenuBarModel extends org.apache.royale.html.beads.models.MenuBarModel
+	public interface IMenuBarModel extends IEventDispatcher, ISelectionModel, IBeadModel
 	{
+        // TODO: should extend ITextModel
         /**
-         *  Constructor.
-         *  
+         *  The text displayed in the ComboBox.
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.0
          */
-		public function MenuBarModel()
-		{
-            labelField = "label";
-            submenuField = "children";
-		}
+		function get submenuField():String;
+		function set submenuField(value:String):void;
 		
-        private var _showRoot:Boolean;
-		
-        /**
-         *  showRoot
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
-         */
-		public function get showRoot():Boolean
-		{
-            return _showRoot;
-		}
-        public function set showRoot(value:Boolean):void
-        {
-            _showRoot = value;
-        }
-        
-        override public function get dataProvider():Object
-        {
-            if (!showRoot)
-                return super.dataProvider.children; // TODO: needs to use descriptor
-            
-            return super.dataProvider;
-        }
 	}
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as
index 4df5cad..8d0b6f8 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/MenuBarModel.as
@@ -21,8 +21,10 @@ package mx.controls.beads.models
     import mx.controls.MenuBar;
     
     import org.apache.royale.core.IMenu;
+    import org.apache.royale.core.IMenuBarModel;
     import org.apache.royale.core.IUIBase;
-    import org.apache.royale.html.beads.models.MenuBarModel;
+    import org.apache.royale.events.Event;
+    import org.apache.royale.html.beads.models.ArraySelectionModel;
 	
     /**
      *  MenuBar Mouse Controller
@@ -32,7 +34,7 @@ package mx.controls.beads.models
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-	public class MenuBarModel extends org.apache.royale.html.beads.models.MenuBarModel
+	public class MenuBarModel extends ArraySelectionModel implements IMenuBarModel
 	{
         /**
          *  Constructor.
@@ -48,6 +50,27 @@ package mx.controls.beads.models
             submenuField = "children";
 		}
 		
+        private var _submenuField:String = "menu";
+        
+        /**
+         * The field in the data object that identifies sub-menus. The default is "menu". This
+         * value is transferred to the CascadingMenu opened for each menu item.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get submenuField():String
+        {
+            return _submenuField;
+        }
+        public function set submenuField(value:String):void
+        {
+            _submenuField = value;
+            dispatchEvent(new Event("submenuFieldChanged"));
+        }
+
         private var _showRoot:Boolean;
 		
         /**


[royale-asjs] 19/21: adjust test script since click is currenly required in JS menus

Posted by ah...@apache.org.
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

commit 67c1a3afcad699a76b30c1129c41f4d039d2f203
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 20:36:12 2018 -0700

    adjust test script since click is currenly required in JS menus
---
 mustella/tests/mxtests/basicTests/halo/scripts/MenuBarTestScript.mxml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mustella/tests/mxtests/basicTests/halo/scripts/MenuBarTestScript.mxml b/mustella/tests/mxtests/basicTests/halo/scripts/MenuBarTestScript.mxml
index 8e13fed..4310040 100644
--- a/mustella/tests/mxtests/basicTests/halo/scripts/MenuBarTestScript.mxml
+++ b/mustella/tests/mxtests/basicTests/halo/scripts/MenuBarTestScript.mxml
@@ -90,8 +90,11 @@
                 <DispatchMouseClickEvent target="haloMenuBarTests.testMenuBar.menuBarItems.1" localX="10" localY="10" />
                 <!-- unable to override menuitem height right now -->
                 <DispatchMouseEvent target="haloMenuBarTests.testMenuBar.menus.0" type="mouseOver" localX="20" localY="40" />
+                <!-- menu on JS required CLICK so temporarily replace with DispatchMouseClickEvent
                 <DispatchMouseEvent target="haloMenuBarTests.testMenuBar.menus.0" type="mouseDown" localX="20" localY="40" />
                 <DispatchMouseEvent target="haloMenuBarTests.testMenuBar.menus.0" type="mouseUp" localX="20" localY="40" />
+                -->
+                <DispatchMouseClickEvent target="haloMenuBarTests.testMenuBar.menus.0" localX="20" localY="40" />
                 <AssertPropertyValue target="haloMenuBarTests.testMenuLabel" propertyName="text" value="Paste" />
                 <!-- visible isn't changed when menus pulled off the display list
                 <AssertPropertyValue target="haloMenuBarTests.testMenuBar.menus.0" propertyName="visible" value="false" />


[royale-asjs] 08/21: update ComboBoxModel to handle ICollectionView

Posted by ah...@apache.org.
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

commit 656f2e41a72ffe64407247bac5d2df3cc88335a3
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:40:17 2018 -0700

    update ComboBoxModel to handle ICollectionView
---
 .../mx/controls/beads/models/ComboBoxModel.as      | 101 +++++++++++++++++++++
 1 file changed, 101 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/ComboBoxModel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/ComboBoxModel.as
new file mode 100644
index 0000000..d23a21b
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/ComboBoxModel.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.controls.beads.models
+{
+    
+    import org.apache.royale.core.IComboBoxModel;
+    import org.apache.royale.core.IUIBase;
+    import mx.controls.beads.models.SingleSelectionICollectionViewModel;
+    import org.apache.royale.events.Event;
+	
+    /**
+     *  MenuBar Mouse Controller
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+	public class ComboBoxModel extends SingleSelectionICollectionViewModel implements IComboBoxModel
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+		public function ComboBoxModel()
+		{
+		}
+		
+        private var _text:String;
+        
+        /**
+         *  The string to display in the org.apache.royale.html.ComboBox input field.
+         * 
+         *  @copy org.apache.royale.core.IComboBoxModel#text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get text():String
+        {
+            return _text;
+        }
+        
+        public function set text(value:String):void
+        {
+            if (value != _text)
+            {
+                _text = value;
+                dispatchEvent(new Event("textChange"));
+            }
+        }
+        
+        private var _html:String;
+        
+        /**
+         *  The HTML string to display in the org.apache.royale.html.ComboBox input field.
+         * 
+         *  @copy org.apache.royale.core.IComboBoxModel#html
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get html():String
+        {
+            return _html;
+        }
+        
+        public function set html(value:String):void
+        {
+            if (value != _html)
+            {
+                _html = value;
+                dispatchEvent(new Event("htmlChange"));
+            }
+        }
+	}
+}


Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent cha...

Posted by Carlos Rovira <ca...@apache.org>.
Yes, Alex, don't worry, is just that I'd like in the future have that kind
of email description so we can figure easily a change, or maybe we can run
into some time needed to fix things and maybe we could not have that at
that time. I fixed things and test that was ok :)

Thanks

El vie., 28 sept. 2018 a las 17:32, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Hi Carlos,
>
> Sorry, I thought I'd run the full build before checking in, but I guess I
> didn't.  Looks like you figured out the required changes.
>
> Thanks,
> -Alex
>
> On 9/28/18, 1:17 AM, "Carlos Rovira" <ca...@apache.org> wrote:
>
>     Hi Alex,
>
>     this change breaks build in different points. I still didn't look at
> what
>     the change implies, and sure that is good, but I think this kind of
> changes
>     that breaks code in other libs should be do with the fix for that libs
> in
>     the same commit or in the next one. If not possible, at least and email
>     explaining in few lines the change and posting how to fix the code
> would be
>     great, so I can fix for example in Jewel where compilation is failing
> in
>     various classes.
>
>     thanks
>
>
>
>
>
>
>     El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:
>
>     > This is an automated email from the ASF dual-hosted git repository.
>     >
>     > aharui pushed a commit to branch develop
>     > in repository
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=lSjVFtsakM9VGgH8vBaqb7GWquxgl%2BV5D4StogmAdMs%3D&amp;reserved=0
>     >
>     > commit 642e35c553023301c01e2ff63d01780a6702a708
>     > Author: Alex Harui <ah...@apache.org>
>     > AuthorDate: Thu Sep 27 20:40:39 2018 -0700
>     >
>     >     refactor popuphost to have a reference from the effective parent
> back
>     > to the popuphost.  this is better than walking the parent chain
> because in
>     > JS we are going to host the popups off the system manager so there
> is no
>     > parent chain to walk.  Using systemmanager moves the popups out of
> the
>     > childlist in the application where the layouts try to run on the
> popup,
>     > which may not be a UIComponent (if it is a re-used UIBase from
> Basic).
>     > ---
>     >  .../royale/org/apache/royale/core/Application.as   | 10 +++-
>     >  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
>     >  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
>     >  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
>     >  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
>     >  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
>     >  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
>     >  .../src/main/royale/mx/managers/SystemManager.as   | 53
>     > ++++++++++++++++++++--
>     >  8 files changed, 113 insertions(+), 25 deletions(-)
>     >
>     > diff --git
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > index 6304126..efa7459 100644
>     > ---
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > +++
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > @@ -105,7 +105,7 @@ package org.apache.royale.core
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public class Application extends ApplicationBase implements
> IStrand,
>     > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
>     > IRenderedObject
>     > +    public class Application extends ApplicationBase implements
> IStrand,
>     > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
>     > IPopUpHostParent, IRenderedObject
>     >      {
>     >          /**
>     >           *  Constructor.
>     > @@ -329,7 +329,7 @@ package org.apache.royale.core
>     >           *  @playerversion AIR 2.6
>     >           *  @productversion Royale 0.0
>     >           */
>     > -        public function get popUpParent():IParent
>     > +        public function get popUpParent():IPopUpHostParent
>     >          {
>     >              return this;
>     >          }
>     > @@ -723,5 +723,11 @@ package org.apache.royale.core
>     >              // Setting this directly doesn't do anything
>     >          }
>     >
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return this;
>     > +        }
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > index 33d9bcd..8bc8876 100644
>     > ---
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > +++
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > @@ -48,7 +48,7 @@ package org.apache.royale.core
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -       public class ViewBase extends GroupBase implements
> IPopUpHost,
>     > IApplicationView
>     > +       public class ViewBase extends GroupBase implements
> IPopUpHost,
>     > IPopUpHostParent, IApplicationView
>     >         {
>     >          /**
>     >           *  Constructor.
>     > @@ -101,10 +101,17 @@ package org.apache.royale.core
>     >           *  @playerversion AIR 2.6
>     >           *  @productversion Royale 0.0
>     >           */
>     > -        public function get popUpParent():IParent
>     > +        public function get popUpParent():IPopUpHostParent
>     >          {
>     >              return this;
>     >          }
>     >
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return this;
>     > +        }
>     > +
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > index a3b4601..6689b1e 100644
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > @@ -30,7 +30,7 @@ package org.apache.royale.core
>     >       *
>     >       *  @royalesuppresspublicvarwarning
>     >       */
>     > -       public class ContainerBaseStrandChildren implements IParent
>     > +       public class ContainerBaseStrandChildren implements
>     > IPopUpHostParent
>     >         {
>     >          /**
>     >           *  Constructor.
>     > @@ -98,5 +98,13 @@ package org.apache.royale.core
>     >                 {
>     >                         return owner.$getElementAt(index);
>     >                 }
>     > +
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return owner as IPopUpHost;
>     > +        }
>     > +
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > index 6b62b10..b08ef88 100755
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > @@ -29,6 +29,6 @@ package org.apache.royale.core
>     >       */
>     >      public interface IPopUpHost
>     >         {
>     > -        function get popUpParent():IParent;
>     > +        function get popUpParent():IPopUpHostParent;
>     >         }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > similarity index 77%
>     > copy from
>     >
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > copy to
>     >
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > index 6b62b10..cbec474 100755
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > @@ -19,16 +19,18 @@
>     >  package org.apache.royale.core
>     >  {
>     >      /**
>     > -     *  The IPopUpHost interface is a "marker" interface for a
> component
>     > that
>     > -     *  parents components that implement IPopUp.
>     > +     *  The IPopUpHostParent is the effective parent of popups.
>     > +     *  The actual parent may not be the effective parent in some
>     > +     *  implementations, so the effective parent provides a
> reference
>     > +     *  back to the IPopUpHost for removing
>     >       *
>     >       *  @langversion 3.0
>     >       *  @playerversion Flash 10.2
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public interface IPopUpHost
>     > +    public interface IPopUpHostParent extends IParent
>     >         {
>     > -        function get popUpParent():IParent;
>     > +        function get popUpHost():IPopUpHost;
>     >         }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > index c5ea044..de6d827 100644
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > @@ -21,6 +21,7 @@ package org.apache.royale.utils
>     >         import org.apache.royale.core.IChild;
>     >         import org.apache.royale.core.IParent;
>     >         import org.apache.royale.core.IPopUpHost;
>     > +    import org.apache.royale.core.IPopUpHostParent;
>     >         import org.apache.royale.core.IUIBase;
>     >
>     >         /**
>     > @@ -81,6 +82,9 @@ package org.apache.royale.utils
>     >                  */
>     >                 public static function
>     > findPopUpHost(start:IUIBase):IPopUpHost
>     >                 {
>     > +            if (start.parent is IPopUpHostParent)
>     > +                return (start.parent as IPopUpHostParent).popUpHost;
>     > +
>     >                         while( start && !(start is IPopUpHost) ) {
>     >                                 // start.parent will be undefined in
> js if
>     > it's not an IChild and return null
>     >                                 COMPILE::SWF
>     > @@ -105,16 +109,11 @@ package org.apache.royale.utils
>     >                  *  @playerversion AIR 2.6
>     >                  *  @productversion Royale 0.9
>     >                  *  @royaleignorecoercion
> org.apache.royale.core.IChild
>     > -                *  @royaleignorecoercion
> org.apache.royale.core.IPopUpHost
>     > +                *  @royaleignorecoercion
>     > org.apache.royale.core.IPopUpHostParent
>     >                  */
>     >                 public static function removePopUp(popUp:IChild):void
>     >                 {
>     > -                       //TODO (harbs) The loop appears to not be
> needed.
>     > If removeElement is being called, it seems like the IPopUpHost would
> be the
>     > direct parent.
>     > -                       var start:IParent = popUp.parent;
>     > -                       while(!(start is IPopUpHost)) {
>     > -                               start = IChild(start).parent;
>     > -                       }
>     > -                       (start as
>     > IPopUpHost).popUpParent.removeElement(popUp);
>     > +                       (popUp.parent as
>     > IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
>     >                 }
>     >         }
>     >  }
>     > diff --git
>     > a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > index 59fe205..a1fae52 100644
>     > ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
>     >  import mx.events.FlexEvent;
>     >  import mx.managers.IActiveWindowManager;
>     >  import mx.managers.ILayoutManager;
>     > -import mx.managers.ISystemManager;
>     >  import mx.styles.CSSStyleDeclaration;
>     >  import mx.styles.IStyleClient;
>     >  import mx.utils.LoaderUtil;
>     > @@ -61,6 +60,7 @@ import
>     > org.apache.royale.events.utils.MouseEventConverter;
>     >  import mx.containers.beads.ApplicationLayout;
>     >  import mx.containers.beads.BoxLayout;
>     >  import mx.managers.FocusManager;
>     > +import mx.managers.ISystemManager;
>     >
>     >  import org.apache.royale.binding.ApplicationDataBinding;
>     >  import org.apache.royale.binding.ContainerDataBinding;
>     > @@ -72,6 +72,7 @@ import
> org.apache.royale.core.IInitialViewApplication;
>     >  import org.apache.royale.core.ILayoutChild;
>     >  import org.apache.royale.core.IParent;
>     >  import org.apache.royale.core.IPopUpHost;
>     > +import org.apache.royale.core.IPopUpHostParent;
>     >  import org.apache.royale.core.IRenderedObject;
>     >  import org.apache.royale.core.IStatesImpl;
>     >  import org.apache.royale.core.IStrand;
>     > @@ -231,7 +232,7 @@ import
>     > org.apache.royale.utils.loadBeadFromValuesManager;
>     >   *  @playerversion AIR 1.1
>     >   *  @productversion Flex 3
>     >   */
>     > -public class Application extends Container implements IStrand,
> IParent,
>     > IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
>     > +public class Application extends Container implements IStrand,
> IParent,
>     > IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject,
> IFlexInfo
>     >  {
>     >
>     >
>     >
> //--------------------------------------------------------------------------
>     > @@ -642,10 +643,30 @@ public class Application extends Container
>     > implements IStrand, IParent, IEventDi
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public function get popUpParent():IParent
>     > +    public function get popUpParent():IPopUpHostParent
>     >      {
>     > -        return strandChildren;
>     > +        COMPILE::JS
>     > +        {
>     > +            return systemManager as IPopUpHostParent;
>     > +        }
>     > +        COMPILE::SWF
>     > +        {
>     > +            return strandChildren as IPopUpHostParent;
>     > +        }
>     >      }
>     > +
>     > +    override public function get systemManager():ISystemManager
>     > +    {
>     > +        return parent as ISystemManager;
>     > +    }
>     > +
>     > +    /**
>     > +     */
>     > +    public function get popUpHost():IPopUpHost
>     > +    {
>     > +        return this;
>     > +    }
>     > +
>     >  }
>     >
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > index c341008..7542e15 100644
>     > ---
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > +++
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
>     >  use namespace mx_internal;
>     >  */
>     >
>     > -import org.apache.royale.geom.Rectangle;
>     > -
>     >  import mx.core.IChildList;
>     >  import mx.core.IFlexDisplayObject;
>     >  import mx.core.IUIComponent;
>     >
>     > +import org.apache.royale.core.IChild;
>     > +import org.apache.royale.core.IPopUpHost;
>     > +import org.apache.royale.core.IPopUpHostParent;
>     >  import org.apache.royale.core.IUIBase;
>     >  import org.apache.royale.events.IEventDispatcher;
>     > +import org.apache.royale.geom.Rectangle;
>     >
>     >  //--------------------------------------
>     >  //  Events
>     > @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
>     >   *  @playerversion AIR 1.1
>     >   *  @productversion Royale 0.9.4
>     >   */
>     > -public class SystemManager extends SystemManagerBase implements
>     > ISystemManager, IEventDispatcher, IChildList
>     > +public class SystemManager extends SystemManagerBase implements
>     > ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
>     >  { //extends MovieClip implements
> IFlexDisplayObject,IFlexModuleFactory,
>     > ISystemManager
>     >     // include "../core/Version.as";
>     >
>     > @@ -1821,7 +1823,43 @@ public class SystemManager extends
>     > SystemManagerBase implements ISystemManager,
>     >              return ret as IUIComponent;
>     >          }
>     >      }
>     > -
>     > +
>     > +    COMPILE::SWF
>     > +    public function addElement(c:IChild, dispatchEvent:Boolean =
>     > true):void
>     > +    {
>     > +        trace("SystemManager:addElement should not be called");
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function addElementAt(c:IChild, index:int,
>     > dispatchEvent:Boolean = true):void
>     > +    {
>     > +        trace("SystemManager:addElementAt should not be called");
>     > +
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function removeElement(c:IChild, dispatchEvent:Boolean =
>     > true):void
>     > +    {
>     > +        trace("SystemManager:removeElement should not be called");
>     > +
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function getElementIndex(c:IChild):int
>     > +    {
>     > +        trace("SystemManager:getElementIndex should not be called");
>     > +        return 0;
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function get numElements():int
>     > +    {
>     > +        trace("SystemManager:numElements should not be called");
>     > +        return 0;
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function getElementAt(index:int):IChild
>     > +    {
>     > +        trace("SystemManager:getElementAt should not be called");
>     > +        return null;
>     > +    }
>     > +
>     >
>     >
> //--------------------------------------------------------------------------
>     >      //
>     >      //  Methods: IFlexModuleFactory
>     > @@ -3667,6 +3705,13 @@ public class SystemManager extends
>     > SystemManagerBase implements ISystemManager,
>     >          return true;
>     >      }
>     >
>     > +    /**
>     > +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
>     > +     */
>     > +    public function get popUpHost():IPopUpHost
>     > +    {
>     > +        return component as IPopUpHost;
>     > +    }
>     >
>     >  }
>     >
>     >
>     >
>
>     --
>     Carlos Rovira
>
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=JUvqd6YKFW3MJC%2BuBOxTJm%2FK2qi2h62QiHLzhXhLO5Q%3D&amp;reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent cha...

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Carlos,

Sorry, I thought I'd run the full build before checking in, but I guess I didn't.  Looks like you figured out the required changes.

Thanks,
-Alex

On 9/28/18, 1:17 AM, "Carlos Rovira" <ca...@apache.org> wrote:

    Hi Alex,
    
    this change breaks build in different points. I still didn't look at what
    the change implies, and sure that is good, but I think this kind of changes
    that breaks code in other libs should be do with the fix for that libs in
    the same commit or in the next one. If not possible, at least and email
    explaining in few lines the change and posting how to fix the code would be
    great, so I can fix for example in Jewel where compilation is failing in
    various classes.
    
    thanks
    
    
    
    
    
    
    El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:
    
    > This is an automated email from the ASF dual-hosted git repository.
    >
    > aharui pushed a commit to branch develop
    > in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=lSjVFtsakM9VGgH8vBaqb7GWquxgl%2BV5D4StogmAdMs%3D&amp;reserved=0
    >
    > commit 642e35c553023301c01e2ff63d01780a6702a708
    > Author: Alex Harui <ah...@apache.org>
    > AuthorDate: Thu Sep 27 20:40:39 2018 -0700
    >
    >     refactor popuphost to have a reference from the effective parent back
    > to the popuphost.  this is better than walking the parent chain because in
    > JS we are going to host the popups off the system manager so there is no
    > parent chain to walk.  Using systemmanager moves the popups out of the
    > childlist in the application where the layouts try to run on the popup,
    > which may not be a UIComponent (if it is a re-used UIBase from Basic).
    > ---
    >  .../royale/org/apache/royale/core/Application.as   | 10 +++-
    >  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
    >  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
    >  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
    >  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
    >  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
    >  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
    >  .../src/main/royale/mx/managers/SystemManager.as   | 53
    > ++++++++++++++++++++--
    >  8 files changed, 113 insertions(+), 25 deletions(-)
    >
    > diff --git
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > index 6304126..efa7459 100644
    > ---
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > +++
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > @@ -105,7 +105,7 @@ package org.apache.royale.core
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public class Application extends ApplicationBase implements IStrand,
    > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
    > IRenderedObject
    > +    public class Application extends ApplicationBase implements IStrand,
    > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
    > IPopUpHostParent, IRenderedObject
    >      {
    >          /**
    >           *  Constructor.
    > @@ -329,7 +329,7 @@ package org.apache.royale.core
    >           *  @playerversion AIR 2.6
    >           *  @productversion Royale 0.0
    >           */
    > -        public function get popUpParent():IParent
    > +        public function get popUpParent():IPopUpHostParent
    >          {
    >              return this;
    >          }
    > @@ -723,5 +723,11 @@ package org.apache.royale.core
    >              // Setting this directly doesn't do anything
    >          }
    >
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return this;
    > +        }
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > index 33d9bcd..8bc8876 100644
    > ---
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > +++
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > @@ -48,7 +48,7 @@ package org.apache.royale.core
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -       public class ViewBase extends GroupBase implements IPopUpHost,
    > IApplicationView
    > +       public class ViewBase extends GroupBase implements IPopUpHost,
    > IPopUpHostParent, IApplicationView
    >         {
    >          /**
    >           *  Constructor.
    > @@ -101,10 +101,17 @@ package org.apache.royale.core
    >           *  @playerversion AIR 2.6
    >           *  @productversion Royale 0.0
    >           */
    > -        public function get popUpParent():IParent
    > +        public function get popUpParent():IPopUpHostParent
    >          {
    >              return this;
    >          }
    >
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return this;
    > +        }
    > +
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > index a3b4601..6689b1e 100644
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > @@ -30,7 +30,7 @@ package org.apache.royale.core
    >       *
    >       *  @royalesuppresspublicvarwarning
    >       */
    > -       public class ContainerBaseStrandChildren implements IParent
    > +       public class ContainerBaseStrandChildren implements
    > IPopUpHostParent
    >         {
    >          /**
    >           *  Constructor.
    > @@ -98,5 +98,13 @@ package org.apache.royale.core
    >                 {
    >                         return owner.$getElementAt(index);
    >                 }
    > +
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return owner as IPopUpHost;
    > +        }
    > +
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > index 6b62b10..b08ef88 100755
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > @@ -29,6 +29,6 @@ package org.apache.royale.core
    >       */
    >      public interface IPopUpHost
    >         {
    > -        function get popUpParent():IParent;
    > +        function get popUpParent():IPopUpHostParent;
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > similarity index 77%
    > copy from
    > frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > copy to
    > frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > index 6b62b10..cbec474 100755
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > @@ -19,16 +19,18 @@
    >  package org.apache.royale.core
    >  {
    >      /**
    > -     *  The IPopUpHost interface is a "marker" interface for a component
    > that
    > -     *  parents components that implement IPopUp.
    > +     *  The IPopUpHostParent is the effective parent of popups.
    > +     *  The actual parent may not be the effective parent in some
    > +     *  implementations, so the effective parent provides a reference
    > +     *  back to the IPopUpHost for removing
    >       *
    >       *  @langversion 3.0
    >       *  @playerversion Flash 10.2
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public interface IPopUpHost
    > +    public interface IPopUpHostParent extends IParent
    >         {
    > -        function get popUpParent():IParent;
    > +        function get popUpHost():IPopUpHost;
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > index c5ea044..de6d827 100644
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > @@ -21,6 +21,7 @@ package org.apache.royale.utils
    >         import org.apache.royale.core.IChild;
    >         import org.apache.royale.core.IParent;
    >         import org.apache.royale.core.IPopUpHost;
    > +    import org.apache.royale.core.IPopUpHostParent;
    >         import org.apache.royale.core.IUIBase;
    >
    >         /**
    > @@ -81,6 +82,9 @@ package org.apache.royale.utils
    >                  */
    >                 public static function
    > findPopUpHost(start:IUIBase):IPopUpHost
    >                 {
    > +            if (start.parent is IPopUpHostParent)
    > +                return (start.parent as IPopUpHostParent).popUpHost;
    > +
    >                         while( start && !(start is IPopUpHost) ) {
    >                                 // start.parent will be undefined in js if
    > it's not an IChild and return null
    >                                 COMPILE::SWF
    > @@ -105,16 +109,11 @@ package org.apache.royale.utils
    >                  *  @playerversion AIR 2.6
    >                  *  @productversion Royale 0.9
    >                  *  @royaleignorecoercion org.apache.royale.core.IChild
    > -                *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
    > +                *  @royaleignorecoercion
    > org.apache.royale.core.IPopUpHostParent
    >                  */
    >                 public static function removePopUp(popUp:IChild):void
    >                 {
    > -                       //TODO (harbs) The loop appears to not be needed.
    > If removeElement is being called, it seems like the IPopUpHost would be the
    > direct parent.
    > -                       var start:IParent = popUp.parent;
    > -                       while(!(start is IPopUpHost)) {
    > -                               start = IChild(start).parent;
    > -                       }
    > -                       (start as
    > IPopUpHost).popUpParent.removeElement(popUp);
    > +                       (popUp.parent as
    > IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
    >                 }
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > index 59fe205..a1fae52 100644
    > --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
    >  import mx.events.FlexEvent;
    >  import mx.managers.IActiveWindowManager;
    >  import mx.managers.ILayoutManager;
    > -import mx.managers.ISystemManager;
    >  import mx.styles.CSSStyleDeclaration;
    >  import mx.styles.IStyleClient;
    >  import mx.utils.LoaderUtil;
    > @@ -61,6 +60,7 @@ import
    > org.apache.royale.events.utils.MouseEventConverter;
    >  import mx.containers.beads.ApplicationLayout;
    >  import mx.containers.beads.BoxLayout;
    >  import mx.managers.FocusManager;
    > +import mx.managers.ISystemManager;
    >
    >  import org.apache.royale.binding.ApplicationDataBinding;
    >  import org.apache.royale.binding.ContainerDataBinding;
    > @@ -72,6 +72,7 @@ import org.apache.royale.core.IInitialViewApplication;
    >  import org.apache.royale.core.ILayoutChild;
    >  import org.apache.royale.core.IParent;
    >  import org.apache.royale.core.IPopUpHost;
    > +import org.apache.royale.core.IPopUpHostParent;
    >  import org.apache.royale.core.IRenderedObject;
    >  import org.apache.royale.core.IStatesImpl;
    >  import org.apache.royale.core.IStrand;
    > @@ -231,7 +232,7 @@ import
    > org.apache.royale.utils.loadBeadFromValuesManager;
    >   *  @playerversion AIR 1.1
    >   *  @productversion Flex 3
    >   */
    > -public class Application extends Container implements IStrand, IParent,
    > IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
    > +public class Application extends Container implements IStrand, IParent,
    > IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
    >  {
    >
    >
    >  //--------------------------------------------------------------------------
    > @@ -642,10 +643,30 @@ public class Application extends Container
    > implements IStrand, IParent, IEventDi
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public function get popUpParent():IParent
    > +    public function get popUpParent():IPopUpHostParent
    >      {
    > -        return strandChildren;
    > +        COMPILE::JS
    > +        {
    > +            return systemManager as IPopUpHostParent;
    > +        }
    > +        COMPILE::SWF
    > +        {
    > +            return strandChildren as IPopUpHostParent;
    > +        }
    >      }
    > +
    > +    override public function get systemManager():ISystemManager
    > +    {
    > +        return parent as ISystemManager;
    > +    }
    > +
    > +    /**
    > +     */
    > +    public function get popUpHost():IPopUpHost
    > +    {
    > +        return this;
    > +    }
    > +
    >  }
    >
    >  }
    > diff --git
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > index c341008..7542e15 100644
    > ---
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > +++
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
    >  use namespace mx_internal;
    >  */
    >
    > -import org.apache.royale.geom.Rectangle;
    > -
    >  import mx.core.IChildList;
    >  import mx.core.IFlexDisplayObject;
    >  import mx.core.IUIComponent;
    >
    > +import org.apache.royale.core.IChild;
    > +import org.apache.royale.core.IPopUpHost;
    > +import org.apache.royale.core.IPopUpHostParent;
    >  import org.apache.royale.core.IUIBase;
    >  import org.apache.royale.events.IEventDispatcher;
    > +import org.apache.royale.geom.Rectangle;
    >
    >  //--------------------------------------
    >  //  Events
    > @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
    >   *  @playerversion AIR 1.1
    >   *  @productversion Royale 0.9.4
    >   */
    > -public class SystemManager extends SystemManagerBase implements
    > ISystemManager, IEventDispatcher, IChildList
    > +public class SystemManager extends SystemManagerBase implements
    > ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
    >  { //extends MovieClip implements IFlexDisplayObject,IFlexModuleFactory,
    > ISystemManager
    >     // include "../core/Version.as";
    >
    > @@ -1821,7 +1823,43 @@ public class SystemManager extends
    > SystemManagerBase implements ISystemManager,
    >              return ret as IUIComponent;
    >          }
    >      }
    > -
    > +
    > +    COMPILE::SWF
    > +    public function addElement(c:IChild, dispatchEvent:Boolean =
    > true):void
    > +    {
    > +        trace("SystemManager:addElement should not be called");
    > +    }
    > +    COMPILE::SWF
    > +    public function addElementAt(c:IChild, index:int,
    > dispatchEvent:Boolean = true):void
    > +    {
    > +        trace("SystemManager:addElementAt should not be called");
    > +
    > +    }
    > +    COMPILE::SWF
    > +    public function removeElement(c:IChild, dispatchEvent:Boolean =
    > true):void
    > +    {
    > +        trace("SystemManager:removeElement should not be called");
    > +
    > +    }
    > +    COMPILE::SWF
    > +    public function getElementIndex(c:IChild):int
    > +    {
    > +        trace("SystemManager:getElementIndex should not be called");
    > +        return 0;
    > +    }
    > +    COMPILE::SWF
    > +    public function get numElements():int
    > +    {
    > +        trace("SystemManager:numElements should not be called");
    > +        return 0;
    > +    }
    > +    COMPILE::SWF
    > +    public function getElementAt(index:int):IChild
    > +    {
    > +        trace("SystemManager:getElementAt should not be called");
    > +        return null;
    > +    }
    > +
    >
    >  //--------------------------------------------------------------------------
    >      //
    >      //  Methods: IFlexModuleFactory
    > @@ -3667,6 +3705,13 @@ public class SystemManager extends
    > SystemManagerBase implements ISystemManager,
    >          return true;
    >      }
    >
    > +    /**
    > +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
    > +     */
    > +    public function get popUpHost():IPopUpHost
    > +    {
    > +        return component as IPopUpHost;
    > +    }
    >
    >  }
    >
    >
    >
    
    -- 
    Carlos Rovira
    https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=JUvqd6YKFW3MJC%2BuBOxTJm%2FK2qi2h62QiHLzhXhLO5Q%3D&amp;reserved=0
    


Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent chain to walk. Using systemmanager moves the popups out of the childlist in the application where the layouts try to run on the popup, which may not be a UIComponent (if it is a re-used UIBase from Basic).

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

this change breaks build in different points. I still didn't look at what
the change implies, and sure that is good, but I think this kind of changes
that breaks code in other libs should be do with the fix for that libs in
the same commit or in the next one. If not possible, at least and email
explaining in few lines the change and posting how to fix the code would be
great, so I can fix for example in Jewel where compilation is failing in
various classes.

thanks






El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:

> 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
>
> commit 642e35c553023301c01e2ff63d01780a6702a708
> Author: Alex Harui <ah...@apache.org>
> AuthorDate: Thu Sep 27 20:40:39 2018 -0700
>
>     refactor popuphost to have a reference from the effective parent back
> to the popuphost.  this is better than walking the parent chain because in
> JS we are going to host the popups off the system manager so there is no
> parent chain to walk.  Using systemmanager moves the popups out of the
> childlist in the application where the layouts try to run on the popup,
> which may not be a UIComponent (if it is a re-used UIBase from Basic).
> ---
>  .../royale/org/apache/royale/core/Application.as   | 10 +++-
>  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
>  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
>  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
>  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
>  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
>  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
>  .../src/main/royale/mx/managers/SystemManager.as   | 53
> ++++++++++++++++++++--
>  8 files changed, 113 insertions(+), 25 deletions(-)
>
> diff --git
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> index 6304126..efa7459 100644
> ---
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> +++
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> @@ -105,7 +105,7 @@ package org.apache.royale.core
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public class Application extends ApplicationBase implements IStrand,
> IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
> IRenderedObject
> +    public class Application extends ApplicationBase implements IStrand,
> IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
> IPopUpHostParent, IRenderedObject
>      {
>          /**
>           *  Constructor.
> @@ -329,7 +329,7 @@ package org.apache.royale.core
>           *  @playerversion AIR 2.6
>           *  @productversion Royale 0.0
>           */
> -        public function get popUpParent():IParent
> +        public function get popUpParent():IPopUpHostParent
>          {
>              return this;
>          }
> @@ -723,5 +723,11 @@ package org.apache.royale.core
>              // Setting this directly doesn't do anything
>          }
>
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return this;
> +        }
>      }
>  }
> diff --git
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> index 33d9bcd..8bc8876 100644
> ---
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> +++
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> @@ -48,7 +48,7 @@ package org.apache.royale.core
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -       public class ViewBase extends GroupBase implements IPopUpHost,
> IApplicationView
> +       public class ViewBase extends GroupBase implements IPopUpHost,
> IPopUpHostParent, IApplicationView
>         {
>          /**
>           *  Constructor.
> @@ -101,10 +101,17 @@ package org.apache.royale.core
>           *  @playerversion AIR 2.6
>           *  @productversion Royale 0.0
>           */
> -        public function get popUpParent():IParent
> +        public function get popUpParent():IPopUpHostParent
>          {
>              return this;
>          }
>
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return this;
> +        }
> +
>      }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> index a3b4601..6689b1e 100644
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> @@ -30,7 +30,7 @@ package org.apache.royale.core
>       *
>       *  @royalesuppresspublicvarwarning
>       */
> -       public class ContainerBaseStrandChildren implements IParent
> +       public class ContainerBaseStrandChildren implements
> IPopUpHostParent
>         {
>          /**
>           *  Constructor.
> @@ -98,5 +98,13 @@ package org.apache.royale.core
>                 {
>                         return owner.$getElementAt(index);
>                 }
> +
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return owner as IPopUpHost;
> +        }
> +
>      }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> index 6b62b10..b08ef88 100755
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> @@ -29,6 +29,6 @@ package org.apache.royale.core
>       */
>      public interface IPopUpHost
>         {
> -        function get popUpParent():IParent;
> +        function get popUpParent():IPopUpHostParent;
>         }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> similarity index 77%
> copy from
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> copy to
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> index 6b62b10..cbec474 100755
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> @@ -19,16 +19,18 @@
>  package org.apache.royale.core
>  {
>      /**
> -     *  The IPopUpHost interface is a "marker" interface for a component
> that
> -     *  parents components that implement IPopUp.
> +     *  The IPopUpHostParent is the effective parent of popups.
> +     *  The actual parent may not be the effective parent in some
> +     *  implementations, so the effective parent provides a reference
> +     *  back to the IPopUpHost for removing
>       *
>       *  @langversion 3.0
>       *  @playerversion Flash 10.2
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public interface IPopUpHost
> +    public interface IPopUpHostParent extends IParent
>         {
> -        function get popUpParent():IParent;
> +        function get popUpHost():IPopUpHost;
>         }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> index c5ea044..de6d827 100644
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> @@ -21,6 +21,7 @@ package org.apache.royale.utils
>         import org.apache.royale.core.IChild;
>         import org.apache.royale.core.IParent;
>         import org.apache.royale.core.IPopUpHost;
> +    import org.apache.royale.core.IPopUpHostParent;
>         import org.apache.royale.core.IUIBase;
>
>         /**
> @@ -81,6 +82,9 @@ package org.apache.royale.utils
>                  */
>                 public static function
> findPopUpHost(start:IUIBase):IPopUpHost
>                 {
> +            if (start.parent is IPopUpHostParent)
> +                return (start.parent as IPopUpHostParent).popUpHost;
> +
>                         while( start && !(start is IPopUpHost) ) {
>                                 // start.parent will be undefined in js if
> it's not an IChild and return null
>                                 COMPILE::SWF
> @@ -105,16 +109,11 @@ package org.apache.royale.utils
>                  *  @playerversion AIR 2.6
>                  *  @productversion Royale 0.9
>                  *  @royaleignorecoercion org.apache.royale.core.IChild
> -                *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
> +                *  @royaleignorecoercion
> org.apache.royale.core.IPopUpHostParent
>                  */
>                 public static function removePopUp(popUp:IChild):void
>                 {
> -                       //TODO (harbs) The loop appears to not be needed.
> If removeElement is being called, it seems like the IPopUpHost would be the
> direct parent.
> -                       var start:IParent = popUp.parent;
> -                       while(!(start is IPopUpHost)) {
> -                               start = IChild(start).parent;
> -                       }
> -                       (start as
> IPopUpHost).popUpParent.removeElement(popUp);
> +                       (popUp.parent as
> IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
>                 }
>         }
>  }
> diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> index 59fe205..a1fae52 100644
> --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
>  import mx.events.FlexEvent;
>  import mx.managers.IActiveWindowManager;
>  import mx.managers.ILayoutManager;
> -import mx.managers.ISystemManager;
>  import mx.styles.CSSStyleDeclaration;
>  import mx.styles.IStyleClient;
>  import mx.utils.LoaderUtil;
> @@ -61,6 +60,7 @@ import
> org.apache.royale.events.utils.MouseEventConverter;
>  import mx.containers.beads.ApplicationLayout;
>  import mx.containers.beads.BoxLayout;
>  import mx.managers.FocusManager;
> +import mx.managers.ISystemManager;
>
>  import org.apache.royale.binding.ApplicationDataBinding;
>  import org.apache.royale.binding.ContainerDataBinding;
> @@ -72,6 +72,7 @@ import org.apache.royale.core.IInitialViewApplication;
>  import org.apache.royale.core.ILayoutChild;
>  import org.apache.royale.core.IParent;
>  import org.apache.royale.core.IPopUpHost;
> +import org.apache.royale.core.IPopUpHostParent;
>  import org.apache.royale.core.IRenderedObject;
>  import org.apache.royale.core.IStatesImpl;
>  import org.apache.royale.core.IStrand;
> @@ -231,7 +232,7 @@ import
> org.apache.royale.utils.loadBeadFromValuesManager;
>   *  @playerversion AIR 1.1
>   *  @productversion Flex 3
>   */
> -public class Application extends Container implements IStrand, IParent,
> IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
> +public class Application extends Container implements IStrand, IParent,
> IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
>  {
>
>
>  //--------------------------------------------------------------------------
> @@ -642,10 +643,30 @@ public class Application extends Container
> implements IStrand, IParent, IEventDi
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public function get popUpParent():IParent
> +    public function get popUpParent():IPopUpHostParent
>      {
> -        return strandChildren;
> +        COMPILE::JS
> +        {
> +            return systemManager as IPopUpHostParent;
> +        }
> +        COMPILE::SWF
> +        {
> +            return strandChildren as IPopUpHostParent;
> +        }
>      }
> +
> +    override public function get systemManager():ISystemManager
> +    {
> +        return parent as ISystemManager;
> +    }
> +
> +    /**
> +     */
> +    public function get popUpHost():IPopUpHost
> +    {
> +        return this;
> +    }
> +
>  }
>
>  }
> diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> index c341008..7542e15 100644
> ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
>  use namespace mx_internal;
>  */
>
> -import org.apache.royale.geom.Rectangle;
> -
>  import mx.core.IChildList;
>  import mx.core.IFlexDisplayObject;
>  import mx.core.IUIComponent;
>
> +import org.apache.royale.core.IChild;
> +import org.apache.royale.core.IPopUpHost;
> +import org.apache.royale.core.IPopUpHostParent;
>  import org.apache.royale.core.IUIBase;
>  import org.apache.royale.events.IEventDispatcher;
> +import org.apache.royale.geom.Rectangle;
>
>  //--------------------------------------
>  //  Events
> @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
>   *  @playerversion AIR 1.1
>   *  @productversion Royale 0.9.4
>   */
> -public class SystemManager extends SystemManagerBase implements
> ISystemManager, IEventDispatcher, IChildList
> +public class SystemManager extends SystemManagerBase implements
> ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
>  { //extends MovieClip implements IFlexDisplayObject,IFlexModuleFactory,
> ISystemManager
>     // include "../core/Version.as";
>
> @@ -1821,7 +1823,43 @@ public class SystemManager extends
> SystemManagerBase implements ISystemManager,
>              return ret as IUIComponent;
>          }
>      }
> -
> +
> +    COMPILE::SWF
> +    public function addElement(c:IChild, dispatchEvent:Boolean =
> true):void
> +    {
> +        trace("SystemManager:addElement should not be called");
> +    }
> +    COMPILE::SWF
> +    public function addElementAt(c:IChild, index:int,
> dispatchEvent:Boolean = true):void
> +    {
> +        trace("SystemManager:addElementAt should not be called");
> +
> +    }
> +    COMPILE::SWF
> +    public function removeElement(c:IChild, dispatchEvent:Boolean =
> true):void
> +    {
> +        trace("SystemManager:removeElement should not be called");
> +
> +    }
> +    COMPILE::SWF
> +    public function getElementIndex(c:IChild):int
> +    {
> +        trace("SystemManager:getElementIndex should not be called");
> +        return 0;
> +    }
> +    COMPILE::SWF
> +    public function get numElements():int
> +    {
> +        trace("SystemManager:numElements should not be called");
> +        return 0;
> +    }
> +    COMPILE::SWF
> +    public function getElementAt(index:int):IChild
> +    {
> +        trace("SystemManager:getElementAt should not be called");
> +        return null;
> +    }
> +
>
>  //--------------------------------------------------------------------------
>      //
>      //  Methods: IFlexModuleFactory
> @@ -3667,6 +3705,13 @@ public class SystemManager extends
> SystemManagerBase implements ISystemManager,
>          return true;
>      }
>
> +    /**
> +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
> +     */
> +    public function get popUpHost():IPopUpHost
> +    {
> +        return component as IPopUpHost;
> +    }
>
>  }
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

[royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent chain to walk. Using systemmanager moves the popups out of the childlist in the application where the layouts try to run on the popup, which may not be a UIComponent (if it is a re-used UIBase from Basic).

Posted by ah...@apache.org.
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

commit 642e35c553023301c01e2ff63d01780a6702a708
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 20:40:39 2018 -0700

    refactor popuphost to have a reference from the effective parent back to the popuphost.  this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent chain to walk.  Using systemmanager moves the popups out of the childlist in the application where the layouts try to run on the popup, which may not be a UIComponent (if it is a re-used UIBase from Basic).
---
 .../royale/org/apache/royale/core/Application.as   | 10 +++-
 .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
 .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
 .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
 .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
 .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
 .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
 .../src/main/royale/mx/managers/SystemManager.as   | 53 ++++++++++++++++++++--
 8 files changed, 113 insertions(+), 25 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
index 6304126..efa7459 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
@@ -105,7 +105,7 @@ package org.apache.royale.core
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-    public class Application extends ApplicationBase implements IStrand, IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost, IRenderedObject
+    public class Application extends ApplicationBase implements IStrand, IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost, IPopUpHostParent, IRenderedObject
     {
         /**
          *  Constructor.
@@ -329,7 +329,7 @@ package org.apache.royale.core
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.0
          */
-        public function get popUpParent():IParent
+        public function get popUpParent():IPopUpHostParent
         {
             return this;
         }
@@ -723,5 +723,11 @@ package org.apache.royale.core
             // Setting this directly doesn't do anything
         }
 
+        /**
+         */
+        public function get popUpHost():IPopUpHost
+        {
+            return this;
+        }
     }
 }
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
index 33d9bcd..8bc8876 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
@@ -48,7 +48,7 @@ package org.apache.royale.core
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-	public class ViewBase extends GroupBase implements IPopUpHost, IApplicationView
+	public class ViewBase extends GroupBase implements IPopUpHost, IPopUpHostParent, IApplicationView
 	{
         /**
          *  Constructor.
@@ -101,10 +101,17 @@ package org.apache.royale.core
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.0
          */
-        public function get popUpParent():IParent
+        public function get popUpParent():IPopUpHostParent
         {
             return this;
         }
         
+        /**
+         */
+        public function get popUpHost():IPopUpHost
+        {
+            return this;
+        }
+
     }
 }
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
index a3b4601..6689b1e 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
@@ -30,7 +30,7 @@ package org.apache.royale.core
      * 
      *  @royalesuppresspublicvarwarning
      */
-	public class ContainerBaseStrandChildren implements IParent
+	public class ContainerBaseStrandChildren implements IPopUpHostParent
 	{
         /**
          *  Constructor.
@@ -98,5 +98,13 @@ package org.apache.royale.core
 		{
 			return owner.$getElementAt(index);
 		}
+        
+        /**
+         */
+        public function get popUpHost():IPopUpHost
+        {
+            return owner as IPopUpHost;
+        }
+
     }
 }
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
index 6b62b10..b08ef88 100755
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
@@ -29,6 +29,6 @@ package org.apache.royale.core
      */
     public interface IPopUpHost
 	{
-        function get popUpParent():IParent;
+        function get popUpParent():IPopUpHostParent;
 	}
 }
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
similarity index 77%
copy from frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
copy to frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
index 6b62b10..cbec474 100755
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
@@ -19,16 +19,18 @@
 package org.apache.royale.core
 {
     /**
-     *  The IPopUpHost interface is a "marker" interface for a component that
-     *  parents components that implement IPopUp.
+     *  The IPopUpHostParent is the effective parent of popups.
+     *  The actual parent may not be the effective parent in some
+     *  implementations, so the effective parent provides a reference
+     *  back to the IPopUpHost for removing
      * 
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-    public interface IPopUpHost
+    public interface IPopUpHostParent extends IParent
 	{
-        function get popUpParent():IParent;
+        function get popUpHost():IPopUpHost;
 	}
 }
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
index c5ea044..de6d827 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
@@ -21,6 +21,7 @@ package org.apache.royale.utils
 	import org.apache.royale.core.IChild;
 	import org.apache.royale.core.IParent;
 	import org.apache.royale.core.IPopUpHost;
+    import org.apache.royale.core.IPopUpHostParent;
 	import org.apache.royale.core.IUIBase;
 
 	/**
@@ -81,6 +82,9 @@ package org.apache.royale.utils
 		 */
 		public static function findPopUpHost(start:IUIBase):IPopUpHost
 		{
+            if (start.parent is IPopUpHostParent)
+                return (start.parent as IPopUpHostParent).popUpHost;
+            
 			while( start && !(start is IPopUpHost) ) {
 				// start.parent will be undefined in js if it's not an IChild and return null
 				COMPILE::SWF
@@ -105,16 +109,11 @@ package org.apache.royale.utils
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.9
 		 *  @royaleignorecoercion org.apache.royale.core.IChild
-		 *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
+		 *  @royaleignorecoercion org.apache.royale.core.IPopUpHostParent
 		 */
 		public static function removePopUp(popUp:IChild):void
 		{
-			//TODO (harbs) The loop appears to not be needed. If removeElement is being called, it seems like the IPopUpHost would be the direct parent.
-			var start:IParent = popUp.parent;
-			while(!(start is IPopUpHost)) {
-				start = IChild(start).parent;
-			}
-			(start as IPopUpHost).popUpParent.removeElement(popUp);
+			(popUp.parent as IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
 		}
 	}
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
index 59fe205..a1fae52 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
@@ -39,7 +39,6 @@ import mx.effects.EffectManager;
 import mx.events.FlexEvent;
 import mx.managers.IActiveWindowManager;
 import mx.managers.ILayoutManager;
-import mx.managers.ISystemManager;
 import mx.styles.CSSStyleDeclaration;
 import mx.styles.IStyleClient;
 import mx.utils.LoaderUtil;
@@ -61,6 +60,7 @@ import org.apache.royale.events.utils.MouseEventConverter;
 import mx.containers.beads.ApplicationLayout;
 import mx.containers.beads.BoxLayout;
 import mx.managers.FocusManager;
+import mx.managers.ISystemManager;
 
 import org.apache.royale.binding.ApplicationDataBinding;
 import org.apache.royale.binding.ContainerDataBinding;
@@ -72,6 +72,7 @@ import org.apache.royale.core.IInitialViewApplication;
 import org.apache.royale.core.ILayoutChild;
 import org.apache.royale.core.IParent;
 import org.apache.royale.core.IPopUpHost;
+import org.apache.royale.core.IPopUpHostParent;
 import org.apache.royale.core.IRenderedObject;
 import org.apache.royale.core.IStatesImpl;
 import org.apache.royale.core.IStrand;
@@ -231,7 +232,7 @@ import org.apache.royale.utils.loadBeadFromValuesManager;
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
  */
-public class Application extends Container implements IStrand, IParent, IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
+public class Application extends Container implements IStrand, IParent, IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
 {
 
     //--------------------------------------------------------------------------
@@ -642,10 +643,30 @@ public class Application extends Container implements IStrand, IParent, IEventDi
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-    public function get popUpParent():IParent
+    public function get popUpParent():IPopUpHostParent
     {
-        return strandChildren;
+        COMPILE::JS
+        {
+            return systemManager as IPopUpHostParent;
+        }
+        COMPILE::SWF
+        {
+            return strandChildren as IPopUpHostParent;
+        }
     }
+    
+    override public function get systemManager():ISystemManager
+    {
+        return parent as ISystemManager;
+    }
+    
+    /**
+     */
+    public function get popUpHost():IPopUpHost
+    {
+        return this;
+    }
+
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
index c341008..7542e15 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
@@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
 use namespace mx_internal;
 */
 
-import org.apache.royale.geom.Rectangle;
-
 import mx.core.IChildList;
 import mx.core.IFlexDisplayObject;
 import mx.core.IUIComponent;
 
+import org.apache.royale.core.IChild;
+import org.apache.royale.core.IPopUpHost;
+import org.apache.royale.core.IPopUpHostParent;
 import org.apache.royale.core.IUIBase;
 import org.apache.royale.events.IEventDispatcher;
+import org.apache.royale.geom.Rectangle;
 
 //--------------------------------------
 //  Events
@@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
  *  @playerversion AIR 1.1
  *  @productversion Royale 0.9.4
  */
-public class SystemManager extends SystemManagerBase implements ISystemManager, IEventDispatcher, IChildList
+public class SystemManager extends SystemManagerBase implements ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
 { //extends MovieClip implements IFlexDisplayObject,IFlexModuleFactory, ISystemManager
    // include "../core/Version.as";
 
@@ -1821,7 +1823,43 @@ public class SystemManager extends SystemManagerBase implements ISystemManager,
             return ret as IUIComponent;
         }
     }
-            
+    
+    COMPILE::SWF
+    public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        trace("SystemManager:addElement should not be called");   
+    }
+    COMPILE::SWF
+    public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+    {
+        trace("SystemManager:addElementAt should not be called");   
+        
+    }
+    COMPILE::SWF
+    public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        trace("SystemManager:removeElement should not be called");   
+        
+    }
+    COMPILE::SWF
+    public function getElementIndex(c:IChild):int
+    {
+        trace("SystemManager:getElementIndex should not be called");   
+        return 0;
+    }
+    COMPILE::SWF
+    public function get numElements():int
+    {
+        trace("SystemManager:numElements should not be called");   
+        return 0;    
+    }
+    COMPILE::SWF
+    public function getElementAt(index:int):IChild
+    {
+        trace("SystemManager:getElementAt should not be called");   
+        return null;            
+    }
+    
     //--------------------------------------------------------------------------
     //
     //  Methods: IFlexModuleFactory
@@ -3667,6 +3705,13 @@ public class SystemManager extends SystemManagerBase implements ISystemManager,
         return true;
     }
     
+    /**
+     * @royaleignorecoercion org.apache.royale.core.IPopUpHost; 
+     */
+    public function get popUpHost():IPopUpHost
+    {
+        return component as IPopUpHost;
+    }
 
 }
 


[royale-asjs] 09/21: fix datagridcolumn labels

Posted by ah...@apache.org.
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

commit 7f0a980d86cea70b8c25c50605a0e9ab891f0ade
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:41:19 2018 -0700

    fix datagridcolumn labels
---
 .../TextButtonDataGridColumnItemRenderer.as        | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/buttonBarClasses/TextButtonDataGridColumnItemRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/buttonBarClasses/TextButtonDataGridColumnItemRenderer.as
new file mode 100644
index 0000000..9e0652e
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/buttonBarClasses/TextButtonDataGridColumnItemRenderer.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.controls.buttonBarClasses
+{
+import mx.controls.dataGridClasses.DataGridColumn;
+
+import org.apache.royale.html.supportClasses.TextButtonItemRenderer;
+
+/**
+ *  The TextButtonDataGridColumnItemRenderer is the default renderer for mx.controls.DataGrid's columns
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+
+public class TextButtonDataGridColumnItemRenderer extends TextButtonItemRenderer
+{
+    override protected function updateButtonLabelFromData():void
+    {
+        text = data ? (data as DataGridColumn).headerText : "";
+    }
+
+}
+
+}


[royale-asjs] 12/21: SWF needed override

Posted by ah...@apache.org.
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

commit 765c85cd6dafa9e6ccf37bf773733ab35a5a190e
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:42:47 2018 -0700

    SWF needed override
---
 .../MXRoyale/src/main/royale/mx/collections/ListCollectionView.as        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as
index 011c4e9..c14c928 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as
@@ -1153,6 +1153,7 @@ public class ListCollectionView extends Proxy implements ICollectionView, IList
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
+    [SWFOverride(params="flash.events.Event", altparams="org.apache.royale.events.Event"))]
     COMPILE::SWF
     public function dispatchEvent(event:Event):Boolean
     {


[royale-asjs] 18/21: also layout content area when children added

Posted by ah...@apache.org.
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

commit 1939818afbddc4ba061fcc265ce1e41c4c9e7368
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 12:27:04 2018 -0700

    also layout content area when children added
---
 .../MXRoyale/src/main/royale/mx/containers/Panel.as        | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
index e04ea8e..418e54a 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
@@ -67,6 +67,7 @@ import mx.core.UIComponent;
 
 import org.apache.royale.core.IChild;
 import org.apache.royale.events.Event;
+import org.apache.royale.events.ValueEvent;
 
 //--------------------------------------
 //  Styles
@@ -823,6 +824,19 @@ public class Panel extends Container
         var contentView:UIComponent = panelView.contentArea as UIComponent;
         contentView.paddingBottom = value;
     }
+    
+    /**
+     *  @private
+     */
+    override public function childrenAdded():void
+    {
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        panelView.contentArea.dispatchEvent(new ValueEvent("childrenAdded"));
+        super.childrenAdded();
+    }
+    
+
 
 }
 


[royale-asjs] 14/21: fix header text

Posted by ah...@apache.org.
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

commit dc18a7ab21f3da1294e2ae345ed452fbd120eeef
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:45:01 2018 -0700

    fix header text
---
 .../src/main/royale/mx/controls/dataGridClasses/DataGridColumn.as        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/dataGridClasses/DataGridColumn.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/dataGridClasses/DataGridColumn.as
index 2336624..fbee89e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/dataGridClasses/DataGridColumn.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/dataGridClasses/DataGridColumn.as
@@ -277,6 +277,7 @@ public class DataGridColumn extends org.apache.royale.html.supportClasses.DataGr
     public function set headerText(value:String):void
     {
         _headerText = value;
+        label = value;
     }
 
 


[royale-asjs] 11/21: use new classes as beads. Also fix some Panel styling

Posted by ah...@apache.org.
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

commit f8586aeb309897b5d094da7f7cb26fa0da9d9955
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:42:30 2018 -0700

    use new classes as beads.  Also fix some Panel styling
---
 .../MXRoyale/src/main/resources/defaults.css       | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 90617f0..f73ef0b 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -55,7 +55,17 @@ Basic|MenuItemRenderer
 
 Basic|ComboBoxList
 {
-	IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForCollectionView");
+	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.DataItemRendererFactoryForICollectionViewData");
+	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionICollectionViewModel");
+}
+
+Basic|DataGridColumnList {
+	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.DataItemRendererFactoryForICollectionViewData");
+	IItemRenderer: ClassReference("mx.controls.listClasses.ListItemRenderer");
+}
+
+Basic|DataGridButtonBar {
+	IItemRenderer: ClassReference("mx.controls.buttonBarClasses.TextButtonDataGridColumnItemRenderer");
 }
 
 Button
@@ -75,7 +85,7 @@ CheckBox
 
 ComboBox
 {
-	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ComboBoxModel");
+	IBeadModel: ClassReference("mx.controls.beads.models.ComboBoxModel");
 	IBeadView: ClassReference("org.apache.royale.html.beads.ComboBoxView");
 	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ComboBoxController");
 	IPopUp: ClassReference("org.apache.royale.html.supportClasses.ComboBoxList");
@@ -130,11 +140,11 @@ Image
 
 List
 {
-	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ArraySelectionModel");
+	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionICollectionViewModel");
 	IBeadView:  ClassReference("org.apache.royale.html.beads.ListView");			
 	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
 	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout");
-	IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData");
+	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.DataItemRendererFactoryForICollectionViewData");
 	IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory");
 	IItemRenderer: ClassReference("mx.controls.listClasses.ListItemRenderer");
 	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
@@ -216,7 +226,9 @@ Panel
 	IPanelLayout: ClassReference("mx.containers.beads.BoxLayout");
 	IPanelContentArea: ClassReference("mx.core.Container");	
 	background-color: #FFFFFF;
-	border: 1px solid #333333
+	border-width: 1px;
+	border: 1px solid #333333;
+	verticalGap: 0px;
 }
 
 Panel .TitleBar


[royale-asjs] 06/21: allow overriding of what text to display

Posted by ah...@apache.org.
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

commit b41edf6401302854ab323afde991d021cb9343a8
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:36:51 2018 -0700

    allow overriding of what text to display
---
 .../org/apache/royale/html/supportClasses/TextButtonItemRenderer.as     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
index d37ceb5..398d246 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
@@ -80,7 +80,7 @@ package org.apache.royale.html.supportClasses
 		/**
 		 * @royaleignorecoercion String
 		 */
-		private function updateButtonLabelFromData():void
+		protected function updateButtonLabelFromData():void
 		{
 			var valueAsString:String;
 


[royale-asjs] 15/21: handle XML

Posted by ah...@apache.org.
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

commit 3b32ee4c98a2f2a0b9fb4d9df25c1387bc441dcd
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:45:55 2018 -0700

    handle XML
---
 .../royale/mx/controls/listClasses/ListItemRenderer.as     | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListItemRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListItemRenderer.as
index 922aa3f..15192c2 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListItemRenderer.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListItemRenderer.as
@@ -19,10 +19,10 @@
 
 package mx.controls.listClasses
 {
-import org.apache.royale.html.supportClasses.StringItemRenderer;
 import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
-import org.apache.royale.core.layout.EdgeData;
 import org.apache.royale.core.ValuesManager;
+import org.apache.royale.core.layout.EdgeData;
+import org.apache.royale.html.supportClasses.StringItemRenderer;
 
 /**
  *  The ListItemRenderer is the default renderer for mx.controls.List
@@ -46,6 +46,16 @@ public class ListItemRenderer extends StringItemRenderer
             textField.height = h;
         }
     }
+    
+    override protected function dataToString(value:Object):String
+    {
+        if (value is XML)
+        {
+            var xml:XML = value as XML;
+            return xml[labelField];
+        }
+        return super.dataToString(value);
+    }
 
 }
 


[royale-asjs] 05/21: allow overriding of what text is displayed

Posted by ah...@apache.org.
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

commit 1da49c2cf5244d78e454e7ff3233b3d2991f2f1e
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:36:20 2018 -0700

    allow overriding of what text is displayed
---
 .../org/apache/royale/html/supportClasses/StringItemRenderer.as   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
index 5c6c454..4c1a3a0 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
@@ -147,10 +147,14 @@ package org.apache.royale.html.supportClasses
 		override public function set data(value:Object):void
 		{
 			super.data = value;
-            var text:String;
-            this.text = getLabelFromData(this,value);
+            text = dataToString(value);
 		}
 
+        protected function dataToString(value:Object):String
+        {
+            return getLabelFromData(this,value);
+        }
+        
         // COMPILE::JS
         // private var backgroundView:WrappedHTMLElement;
 


[royale-asjs] 03/21: SWF side also needs to dispatch itemMouseDown

Posted by ah...@apache.org.
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

commit 4da068ab7e540b7d438092306ae9f0f6b12b0ead
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:32:51 2018 -0700

    SWF side also needs to dispatch itemMouseDown
---
 .../royale/html/beads/controllers/ItemRendererMouseController.as   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
index db7fee9..35bdf23 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
@@ -157,6 +157,13 @@ COMPILE::JS {
 			if (target)
 			{
                 target.down = true;
+                
+                var newEvent:ItemClickedEvent = new ItemClickedEvent("itemMouseDown");
+                newEvent.data = target.data;
+                newEvent.multipleSelection = event.shiftKey;
+                newEvent.index = target.index;
+                
+                target.dispatchEvent(newEvent);
 				target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
 			}
 		}


[royale-asjs] 07/21: handle ICollectionViews when creating renderers

Posted by ah...@apache.org.
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

commit d50ed882ff21380f1c292d2ac8d6d1b20c799831
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:38:11 2018 -0700

    handle ICollectionViews when creating renderers
---
 ...ataItemRendererFactoryForICollectionViewData.as | 133 +++++++++++++++++++++
 1 file changed, 133 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataItemRendererFactoryForICollectionViewData.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataItemRendererFactoryForICollectionViewData.as
new file mode 100644
index 0000000..cdfb917
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataItemRendererFactoryForICollectionViewData.as
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.controls.listClasses
+{
+	import mx.collections.ICollectionView;
+    import mx.collections.IViewCursor;
+    import mx.collections.ICollectionView;
+	
+	import org.apache.royale.core.IBead;
+	import org.apache.royale.core.IBeadModel;
+	import org.apache.royale.core.IDataProviderItemRendererMapper;
+	import org.apache.royale.core.IDataProviderModel;
+	import org.apache.royale.core.IItemRendererClassFactory;
+	import org.apache.royale.core.IItemRendererParent;
+	import org.apache.royale.core.IListPresentationModel;
+	import org.apache.royale.core.ISelectableItemRenderer;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.core.IUIBase;
+	import org.apache.royale.core.SimpleCSSStyles;
+	import org.apache.royale.core.UIBase;
+	import org.apache.royale.core.ValuesManager;
+	import org.apache.royale.events.Event;
+    import org.apache.royale.events.CollectionEvent;
+	import org.apache.royale.events.EventDispatcher;
+	import org.apache.royale.events.IEventDispatcher;
+	import org.apache.royale.events.ItemRendererEvent;
+	import org.apache.royale.html.List;
+    import org.apache.royale.html.beads.DataItemRendererFactoryForCollectionView;
+	import org.apache.royale.html.supportClasses.TreeListData;
+	
+	[Event(name="itemRendererCreated",type="org.apache.royale.events.ItemRendererEvent")]
+
+    /**
+     *  The DataItemRendererFactoryForHierarchicalData class reads a
+     *  HierarchicalData object 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 Royale 0.0
+     */
+	public class DataItemRendererFactoryForICollectionViewData extends DataItemRendererFactoryForCollectionView
+	{
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+		public function DataItemRendererFactoryForICollectionViewData()
+		{
+			super();
+		}
+
+		private var _strand:IStrand;
+
+        /**
+         *  @copy org.apache.royale.core.IBead#strand
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			super.strand = value;
+		}
+        
+        /**
+         * @private
+         * @royaleignorecoercion mx.collections.ICollectionView
+         * @royaleignorecoercion org.apache.royale.core.IListPresentationModel
+         * @royaleignorecoercion org.apache.royale.core.ISelectableItemRenderer
+         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+         */
+        override protected function dataProviderChangeHandler(event:Event):void
+        {
+            if (!dataProviderModel)
+                return;
+            var dp:ICollectionView = dataProviderModel.dataProvider as ICollectionView;
+            if (!dp)
+                return;
+            
+            // listen for individual items being added in the future.
+            var dped:IEventDispatcher = dp as IEventDispatcher;
+            dped.addEventListener(CollectionEvent.ITEM_ADDED, itemAddedHandler);
+            dped.addEventListener(CollectionEvent.ITEM_REMOVED, itemRemovedHandler);
+            dped.addEventListener(CollectionEvent.ITEM_UPDATED, itemUpdatedHandler);
+            
+            dataGroup.removeAllItemRenderers();
+            
+            var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
+            labelField = dataProviderModel.labelField;
+            
+            var n:int = dp.length;
+            var cursor:IViewCursor = dp.createCursor();
+            for (var i:int = 0; i < n; i++)
+            {
+                var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
+                var item:Object = cursor.current;
+                cursor.moveNext();
+                fillRenderer(i, item, ir, presentationModel);
+            }
+            
+            IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+        }
+		
+	}
+}


[royale-asjs] 01/21: fix construction with XMLList literal.

Posted by ah...@apache.org.
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

commit 738d58f9966d22b91a0bbce0eb9551a1dde338c0
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Sep 25 10:19:18 2018 -0700

    fix construction with XMLList literal.
---
 frameworks/projects/XML/src/main/royale/XMLList.as | 37 ++++++++++++++++++++--
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/XML/src/main/royale/XMLList.as b/frameworks/projects/XML/src/main/royale/XMLList.as
index ebf2e63..e3933ce 100644
--- a/frameworks/projects/XML/src/main/royale/XMLList.as
+++ b/frameworks/projects/XML/src/main/royale/XMLList.as
@@ -44,9 +44,40 @@ package
 			{
 				this[0] = expression;
 			}
-			else
-				this[0] = new XML(expression);
-		}
+			else 
+            {
+                try
+                {
+    				this[0] = new XML(expression);
+                }
+                catch (e:Error)
+                {
+                    if (typeof(expression) === "string")
+                    {
+                        // try adding a wrapping node and then grab the children
+                        expression = "<root>" + expression + "</root>";
+                        try
+                        {
+                            var xml:XML = new XML(expression);
+                            var list:XMLList = xml.children();
+                            var m:int = list.length();
+                            for (var j:int = 0; j < m; j++)
+                            {
+                                this[j] = list[j];
+                            }
+                        }
+                        catch (e2:Error)
+                        {
+                            throw e; // throw original error
+                        }
+                        
+                    }
+                    else
+                        throw e;
+                }
+            }
+		}
+        
 		private var _xmlArray:Array = [];
 		/*
 			9.2.1.2 [[Put]] (P, V)


[royale-asjs] 10/21: add new classes to swc

Posted by ah...@apache.org.
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

commit 04b91aac415e608d05c144ce191a73510b4c2361
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:41:40 2018 -0700

    add new classes to swc
---
 frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 9d9c71b..a25fb29 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -71,6 +71,7 @@ internal class MXRoyaleClasses
 	import mx.rpc.http.HTTPService; mx.rpc.http.HTTPService;
 	import mx.controls.treeClasses.ITreeDataDescriptor; ITreeDataDescriptor;
 	import mx.controls.treeClasses.TreeListData; TreeListData;
+    import mx.controls.listClasses.DataItemRendererFactoryForICollectionViewData; DataItemRendererFactoryForICollectionViewData;
     import mx.controls.treeClasses.DataItemRendererFactoryForICollectionViewHierarchicalData; DataItemRendererFactoryForICollectionViewHierarchicalData;
 	import mx.charts.chartClasses.RenderData; RenderData;
 	import mx.effects.EffectInstance; EffectInstance;
@@ -172,9 +173,11 @@ internal class MXRoyaleClasses
     import mx.containers.beads.models.PanelModel; PanelModel;
     import mx.containers.beads.TabNavigatorView; TabNavigatorView;
     import mx.controls.TabBar; TabBar;
+    import mx.controls.beads.models.ComboBoxModel; ComboBoxModel;
     
     import mx.controls.beads.models.SingleSelectionICollectionViewModel; SingleSelectionICollectionViewModel;
     import mx.controls.beads.models.SingleSelectionIListModel; SingleSelectionIListModel;
+    import mx.controls.buttonBarClasses.TextButtonDataGridColumnItemRenderer; TextButtonDataGridColumnItemRenderer;
     
 }
 


[royale-asjs] 16/21: use ICollectionView

Posted by ah...@apache.org.
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

commit 80846647c8fb99de67c9b7abbf2d46ff882f17a4
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Sep 27 00:46:34 2018 -0700

    use ICollectionView
---
 .../src/main/royale/mx/controls/ComboBase.as       | 35 +++++++++++++++++++++
 .../royale/mx/controls/listClasses/ListBase.as     | 36 ++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/ComboBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/ComboBase.as
index 9a640a1..118144e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/ComboBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/ComboBase.as
@@ -65,6 +65,11 @@ import org.apache.royale.html.beads.IComboBoxView;
 import org.apache.royale.core.IComboBoxModel;
 import org.apache.royale.core.IUIBase;
 import mx.events.FlexEvent;
+import mx.collections.IList;
+import mx.collections.XMLListCollection;
+import mx.collections.ArrayCollection;
+import mx.collections.ICollectionView;
+import mx.collections.ListCollectionView;
     
 /**
  *  The alpha of the content background for this component.
@@ -472,6 +477,36 @@ public class ComboBase extends UIComponent implements /*IIMESupport,*/ IFocusMan
      */
     public function set dataProvider(value:Object):void
     {
+        if (value is Array)
+        {
+            value = new ArrayCollection(value as Array);
+        }
+        else if (value is ICollectionView)
+        {
+            value = ICollectionView(value);
+        }
+        else if (value is IList)
+        {
+            value = new ListCollectionView(IList(value));
+        }
+        else if (value is XMLList)
+        {
+            value = new XMLListCollection(value as XMLList);
+        }
+        else if (value is XML)
+        {
+            var xl:XMLList = new XMLList();
+            xl += value;
+            value = new XMLListCollection(xl);
+        }
+        else
+        {
+            // convert it to an array containing this one item
+            var tmp:Array = [];
+            if (value != null)
+                tmp.push(value);
+            value = new ArrayCollection(tmp);
+        }
         IComboBoxModel(model).dataProvider = value;
         if (value && IComboBoxModel(model).selectedIndex == -1)
             IComboBoxModel(model).selectedIndex = 0;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index 1d723cc..ea2cad6 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -19,12 +19,18 @@
 package mx.controls.listClasses
 {
 
+import mx.collections.ArrayCollection;
+import mx.collections.ICollectionView;
+import mx.collections.IList;
+import mx.collections.ListCollectionView;
+import mx.collections.XMLListCollection;
 import mx.core.EdgeMetrics;
 import mx.core.IFactory;
 import mx.core.IUIComponent;
 import mx.core.ScrollPolicy;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
+import mx.events.CollectionEvent;
 import mx.utils.UIDUtil;
 
 import org.apache.royale.core.ContainerBaseStrandChildren;
@@ -208,6 +214,36 @@ use namespace mx_internal;
          */
         public function set dataProvider(value:Object):void
         {
+            if (value is Array)
+            {
+                value = new ArrayCollection(value as Array);
+            }
+            else if (value is ICollectionView)
+            {
+                value = ICollectionView(value);
+            }
+            else if (value is IList)
+            {
+                value = new ListCollectionView(IList(value));
+            }
+            else if (value is XMLList)
+            {
+                value = new XMLListCollection(value as XMLList);
+            }
+            else if (value is XML)
+            {
+                var xl:XMLList = new XMLList();
+                xl += value;
+                value = new XMLListCollection(xl);
+            }
+            else
+            {
+                // convert it to an array containing this one item
+                var tmp:Array = [];
+                if (value != null)
+                    tmp.push(value);
+                value = new ArrayCollection(tmp);
+            }
             (model as ISelectionModel).dataProvider = value;
         }