You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/04/20 16:43:56 UTC
[GitHub] aharui closed pull request #196: IBrowserManager.as and
BrowserManager.as Added
aharui closed pull request #196: IBrowserManager.as and BrowserManager.as Added
URL: https://github.com/apache/royale-asjs/pull/196
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 03d166f47..2644fc1ff 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -97,6 +97,7 @@ internal class MXRoyaleClasses
import mx.charts.HitData; HitData;
import mx.collections.GroupingField; GroupingField;
import mx.collections.Grouping; Grouping;
+ import mx.managers.BrowserManager; BrowserManager;
import mx.containers.FormHeading; FormHeading;
import mx.charts.chartClasses.DataTransform; DataTransform;
import mx.skins.Border; Border;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/BrowserManager.as b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/BrowserManager.as
new file mode 100644
index 000000000..955755a67
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/BrowserManager.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+//import mx.core.Singleton;
+
+/**
+ * The BrowserManager is a Singleton manager that acts as
+ * a proxy between the browser and the application.
+ * It provides access to the URL in the browser address
+ * bar similar to accessing the <code>document.location</code> property in JavaScript.
+ * Events are dispatched when the <code>url</code> property is changed.
+ * Listeners can then respond, alter the URL, and/or block others
+ * from getting the event.
+ *
+ * <p>To use the BrowserManager, you call the <code>getInstance()</code> method to get the current
+ * instance of the manager, and call methods and listen to
+ * events on that manager. See the IBrowserManager class for the
+ * methods, properties, and events to use.</p>
+ *
+ * @see mx.managers.IBrowserManager
+ * @see mx.managers.HistoryManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class BrowserManager
+{
+ // include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Linker dependency on implementation class.
+ */
+ // private static var implClassDependency:BrowserManagerImpl;
+
+ /**
+ * @private
+ */
+ private static var instance:IBrowserManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns the sole instance of this Singleton class;
+ * creates it if it does not already exist.
+ *
+ * @return Returns the sole instance of this Singleton class;
+ * creates it if it does not already exist.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():IBrowserManager
+ {
+ if (!instance)
+ {
+ /* instance = IBrowserManager(
+ Singleton.getInstance("mx.managers::IBrowserManager")); */
+ }
+
+ return instance;
+ }
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/IBrowserManager.as b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/IBrowserManager.as
new file mode 100644
index 000000000..a84fec6c9
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/IBrowserManager.as
@@ -0,0 +1,85 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+//import flash.events.IEventDispatcher;
+import org.apache.royale.events.IEventDispatcher;
+/**
+ * Dispatched when the URL is changed either
+ * by the user interacting with the browser, invoking an
+ * application in AIR, or by setting the property programmatically.
+ *
+ * @eventType flash.events.Event.CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+//[Event(name="change", type="flash.events.Event")]
+
+/**
+ * Dispatched when the URL is changed
+ * by the browser.
+ *
+ * @eventType mx.events.BrowserChangeEvent.BROWSER_URL_CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+//[Event(name="browserURLChange", type="mx.events.BrowserChangeEvent")]
+
+/**
+ * Dispatched when the URL is changed
+ * by the application.
+ *
+ * @eventType mx.events.BrowserChangeEvent.URL_CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+//[Event(name="urlChange", type="mx.events.BrowserChangeEvent")]
+
+/**
+ * The interface that the shared instance of the BrowserManager
+ * implements. Applications listen for events,
+ * call methods, and access properties on the shared instance
+ * which is accessed with the <code>BrowserManager.getInstance()</code> method.
+ *
+ * @see mx.managers.BrowserManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+public interface IBrowserManager extends org.apache.royale.events.IEventDispatcher
+{
+
+
+}
+
+}
+
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services