FLEX-34979 CAUSE: When the transition was made from the spark Sort and SortField extending AdvancedStyleClient to implementing its interfaces, the omission was that only IAdvancedStyleClient was implemented, as opposed to all three relevant interfaces (IAdvancedStyleClient, IFlexModule, IMXMLObject). More specifically the mustella failures reflected that the function initialized() wasn't present anymore, as that function, called automatically by the framework, is responsible for registering the Sort and SortField instances with the IFlexModuleFactory implementor (FlexModuleFactory or SystemManager, etc.).
SOLUTION: The spark versions of Sort and SortField now also implement IFlexModule and IMXMLObject via AdvancedStyleClientImplementation. NOTES: -also cleaned some imports in AdvancedStyleClient. Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/64216e91 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/64216e91 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/64216e91 Branch: refs/heads/master Commit: 64216e91720cd818da9d478410a117619f7f0fa0 Parents: b29975c Author: Mihai Chira <mih...@apache.org> Authored: Thu Dec 3 15:19:50 2015 +0100 Committer: Mihai Chira <mih...@apache.org> Committed: Thu Dec 3 15:19:50 2015 +0100 ---------------------------------------------------------------------- .../src/mx/styles/AdvancedStyleClient.as | 22 +++++++++----------- .../AdvancedStyleClientImplementation.as | 22 ++++++++++++++++++++ .../spark/src/spark/collections/Sort.as | 9 +++++--- .../spark/src/spark/collections/SortField.as | 7 ++++--- 4 files changed, 42 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/64216e91/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as b/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as index 8ec8a1d..a8b095c 100644 --- a/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as +++ b/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as @@ -20,18 +20,16 @@ package mx.styles { -import flash.events.*; - -import mx.core.FlexGlobals; -import mx.core.IFlexDisplayObject; -import mx.core.IFlexModule; -import mx.core.IFlexModuleFactory; -import mx.core.IMXMLObject; -import mx.core.UIComponent; -import mx.styles.*; -import mx.utils.NameUtil; - -/** + import flash.events.*; + + import mx.core.FlexGlobals; + import mx.core.IFlexModule; + import mx.core.IFlexModuleFactory; + import mx.core.IMXMLObject; + import mx.core.UIComponent; + import mx.utils.NameUtil; + + /** * A base class that can be used * when implementing an object that uses the * <code>IAdvancedStyleClient</code> interface. The base class supplies http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/64216e91/frameworks/projects/spark/src/spark/collections/AdvancedStyleClientImplementation.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/collections/AdvancedStyleClientImplementation.as b/frameworks/projects/spark/src/spark/collections/AdvancedStyleClientImplementation.as index fa2f17f..a1429db 100644 --- a/frameworks/projects/spark/src/spark/collections/AdvancedStyleClientImplementation.as +++ b/frameworks/projects/spark/src/spark/collections/AdvancedStyleClientImplementation.as @@ -1,6 +1,8 @@ +import mx.core.IFlexModuleFactory; import mx.styles.AdvancedStyleClient; import mx.styles.CSSStyleDeclaration; import mx.styles.IAdvancedStyleClient; +import mx.styles.IStyleManager2; //////////////////////////////////////////////////////////////////////////////// // @@ -142,3 +144,23 @@ public function styleChanged(styleProp:String):void { _styleChanged(styleProp); } + +public function get styleManager():IStyleManager2 +{ + return _advancedStyleClient.styleManager; +} + +public function get moduleFactory():IFlexModuleFactory +{ + return _advancedStyleClient.moduleFactory; +} + +public function set moduleFactory(factory:IFlexModuleFactory):void +{ + _advancedStyleClient.moduleFactory = factory; +} + +public function initialized(document:Object, id:String):void +{ + _advancedStyleClient.initialized(document, id); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/64216e91/frameworks/projects/spark/src/spark/collections/Sort.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/collections/Sort.as b/frameworks/projects/spark/src/spark/collections/Sort.as index 912e2dd..d581c9a 100644 --- a/frameworks/projects/spark/src/spark/collections/Sort.as +++ b/frameworks/projects/spark/src/spark/collections/Sort.as @@ -22,6 +22,9 @@ package spark.collections import flash.events.Event; + import mx.core.IFlexModule; + import mx.core.IMXMLObject; + import mx.core.mx_internal; import mx.styles.IAdvancedStyleClient; import mx.collections.ISortField; @@ -190,7 +193,7 @@ package spark.collections * @playerversion AIR 2.5 * @productversion Flex 4.5 */ -public class Sort extends mx.collections.Sort implements IAdvancedStyleClient +public class Sort extends mx.collections.Sort implements IAdvancedStyleClient, IFlexModule, IMXMLObject { include "../core/Version.as"; include "AdvancedStyleClientImplementation.as"; @@ -425,5 +428,5 @@ public class Sort extends mx.collections.Sort implements IAdvancedStyleClient dispatchEvent(new Event(Event.CHANGE)); } -} -} + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/64216e91/frameworks/projects/spark/src/spark/collections/SortField.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/collections/SortField.as b/frameworks/projects/spark/src/spark/collections/SortField.as index 12568e9..814bf34 100644 --- a/frameworks/projects/spark/src/spark/collections/SortField.as +++ b/frameworks/projects/spark/src/spark/collections/SortField.as @@ -24,6 +24,8 @@ package spark.collections import mx.styles.IAdvancedStyleClient; import mx.collections.ISortField; import mx.core.FlexGlobals; + import mx.core.IFlexModule; + import mx.core.IMXMLObject; import mx.utils.ObjectUtil; import spark.globalization.SortingCollator; @@ -153,9 +155,10 @@ package spark.collections * @playerversion AIR 2.5 * @productversion Flex 4.5 */ -public class SortField extends mx.collections.SortField implements IAdvancedStyleClient +public class SortField extends mx.collections.SortField implements IAdvancedStyleClient, IFlexModule, IMXMLObject { include "../core/Version.as"; + include "AdvancedStyleClientImplementation.as"; //-------------------------------------------------------------------------- // @@ -192,8 +195,6 @@ public class SortField extends mx.collections.SortField implements IAdvancedStyl super(name, false, descending, numeric, sortCompareType, customCompareFunction); } - include "AdvancedStyleClientImplementation.as"; - //-------------------------------------------------------------------------- // // Variables