This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 11e5207 jewel-moduleloader: New ModuleLoader. We need to avoid
inheritance to UIBase and set to StyledUIBase
11e5207 is described below
commit 11e5207e7765d0976e53df930d9580eb8d13769b
Author: Carlos Rovira <[email protected]>
AuthorDate: Wed Jun 19 20:20:38 2019 +0200
jewel-moduleloader: New ModuleLoader. We need to avoid inheritance to
UIBase and set to StyledUIBase
---
.../Jewel/src/main/resources/jewel-manifest.xml | 1 +
.../royale/org/apache/royale/jewel/ModuleLoader.as | 125 +++++++++++++++++++++
2 files changed, 126 insertions(+)
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 24fc8fe..877f84a 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -23,6 +23,7 @@
<component id="Application" class="org.apache.royale.jewel.Application"/>
<component id="Module" class="org.apache.royale.jewel.Module"/>
+ <component id="ModuleLoader" class="org.apache.royale.jewel.ModuleLoader"/>
<component id="View" class="org.apache.royale.jewel.View"/>
<component id="Group" class="org.apache.royale.jewel.Group"/>
<component id="HGroup" class="org.apache.royale.jewel.HGroup"/>
diff --git
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ModuleLoader.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ModuleLoader.as
new file mode 100644
index 0000000..bafdd97
--- /dev/null
+++
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ModuleLoader.as
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel
+{
+ import org.apache.royale.core.IUIBase;
+ import org.apache.royale.core.StyledUIBase;
+ import org.apache.royale.utils.PointUtils;
+ import org.apache.royale.utils.UIModuleUtils;
+ import org.apache.royale.geom.Point;
+ import org.apache.royale.events.Event;
+
+ COMPILE::SWF
+ {
+ import flash.display.Loader;
+ import flash.display.DisplayObjectContainer;
+ import flash.events.Event;
+ import flash.system.LoaderContext;
+ import flash.system.ApplicationDomain;
+ import flash.net.URLRequest;
+ }
+
+ COMPILE::JS
+ {
+ import goog.global;
+ import org.apache.royale.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The ModuleLoader class can load a Module.
+ *
+ * @toplevel
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.6
+ */
+ public class ModuleLoader extends StyledUIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.6
+ */
+ public function ModuleLoader()
+ {
+ super();
+ }
+
+ /**
+ * Path or URL of module. This is combined
+ * with the module name and a platform suffix
+ * to determine the actual path or URL of the
+ * module.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.6
+ */
+ public function get modulePath():String
+ {
+ return utils.modulePath;
+ }
+
+ /**
+ * @private.
+ */
+ public function set modulePath(value:String):void
+ {
+ utils.modulePath = value;
+ }
+
+ public function get moduleName():String
+ {
+ return utils.moduleName;
+ }
+
+ public function set moduleName(value:String):void
+ {
+ utils.moduleName = value;
+ }
+
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+ if (utils.moduleName)
+ loadModule();
+ }
+
+ private var utils:UIModuleUtils = new UIModuleUtils();
+
+ /**
+ * Load the module. Will be called automatically if modulePath
+ * is set as the UIModuleLoader is added to the display list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.6
+ */
+ public function loadModule():void
+ {
+ utils.loadModule(this);
+ }
+ }
+}