]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js
git-svn-id: https://svn.argeo.org/slc/trunk@2380 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / Application.js
index 4609bad1eb0c0e765bac05173974d76f7d5d3fa1..a1e5901f18802149bf3ac692af8ec7ea8e71c8ab 100644 (file)
@@ -26,17 +26,29 @@ qx.Class.define("org.argeo.ria.Application",
   },\r
   \r
   properties : {\r
+       /**\r
+        * Available perspective detected in the current compilation.\r
+        */\r
        perspectives : {\r
                check : "Map",\r
                init : {}\r
        },\r
+       /**\r
+        * Currently layouted perspective label\r
+        */\r
        activePerspectiveName : {\r
                check : "String",\r
                init : ""\r
        },\r
+       /**\r
+        *  Currently layouted perspective.\r
+        */\r
        activePerspective : {\r
                init : null\r
        },\r
+       /**\r
+        * Basic command associated to the application, applicable to all perspectives.\r
+        */\r
        commandsDefinitions : {\r
                init : {\r
                        "stop" : {\r
@@ -191,6 +203,10 @@ qx.Class.define("org.argeo.ria.Application",
       this.loadPerspective();\r
     },\r
     \r
+    /**\r
+     * Load a given perspective by its name.\r
+     * @param perspectiveName {String} Perspective to load\r
+     */\r
     loadPerspective : function(perspectiveName){\r
        if(perspectiveName){\r
                this.setActivePerspectiveName(perspectiveName);\r
@@ -214,6 +230,9 @@ qx.Class.define("org.argeo.ria.Application",
                this.setActivePerspective(perspective);\r
     },\r
     \r
+    /**\r
+     * After switching perspective, call this function to rebuild menu with the right selected.\r
+     */\r
     rebuildPerspectiveMenus : function(){\r
             var switchCommand = this.getCommandsDefinitions()["switchperspective"];\r
             switchCommand.submenu = [];\r
@@ -231,11 +250,24 @@ qx.Class.define("org.argeo.ria.Application",
                        switchCommand.command.setMenu(switchCommand.submenu);\r
                }\r
     },\r
+\r
+    /**\r
+     * Specific action of calling an external URL without triggering the "close()" method\r
+     * of Application.\r
+     * @param hrefValue {String} A download url that should reply with specific "attachment" header to avoid leaving the application.\r
+     */\r
+    javascriptDownloadLocation: function(hrefValue){\r
+       this.interruptClose = true;\r
+       document.location.href = hrefValue;\r
+       this.interruptClose = false;\r
+    },\r
     \r
-    terminate : function(){\r
-       alert("toto");\r
+    /**\r
+     * Called at Application ending (closing the browser).\r
+     */\r
+    close : function(){\r
+       if(this.interruptClose) return ;        \r
                if(this.getActivePerspective()){\r
-                       alert(this.getActivePerspective());\r
                        this.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance());\r
                } \r
                this.base(arguments);\r