]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/CommandsManager.js
Handle order, editor, toggle autoOpen when adding to batch, added toggleInitialState...
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / event / CommandsManager.js
index 324a13cdf36afa2fb2749046291756e05bbf077a..f4e38a4084211662b58faa004fe74c20f0398f05 100644 (file)
@@ -84,6 +84,9 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
                init : {},\r
                check : "Map"\r
        },\r
+       /**\r
+        * Special command definitions that are shared between focusable parts. \r
+        */\r
        sharedDefinitions : {\r
                init: {},\r
                check: "Map"\r
@@ -105,6 +108,10 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
 \r
   members :\r
   {\r
+       /**\r
+        * Initialize the manager with basic definitions.\r
+        * @param initDefinitions {Map} A map of commands definitions.\r
+        */\r
        init : function(initDefinitions){\r
                this.setDefinitions(initDefinitions);\r
                this.setInitialDefinitions(qx.lang.Object.copy(initDefinitions));\r
@@ -133,6 +140,9 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
                                command.setEnabled(definition.enabled);\r
                                if(definition.toggle){\r
                                        command.setToggle(true);\r
+                                       if(definition.toggleInitialState){\r
+                                               command.setToggleInitialState(definition.toggleInitialState);\r
+                                       }\r
                                }\r
                                this._attachListener(command, definition.callback, definition.callbackContext);\r
                                if(definition.init){\r
@@ -284,7 +294,8 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
        /**\r
         * Add a new set of commands definitions. See the definitions property of this class.\r
         * @param definitions {Map} a set of commands definitions.\r
-        * @param callbackContext {qx.ui.core.Object} The context used inside the commands callbacks. \r
+        * @param callbackContext {qx.ui.core.Object} The context used inside the commands callbacks.\r
+        * @param focusablePartId {String} A string identifying the associated focusable part, like "view:viewId". \r
         */\r
        addCommands : function(definitions, callbackContext, focusablePartId){\r
                var crtDefs = this.getDefinitions();            \r
@@ -309,6 +320,7 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
        /**\r
         * Removes a whole set of commands by their definitions maps.\r
         * @param definitions {Map} a set of commands definitions\r
+        * @param focusablePartId {String} A string identifying the associated focusable part, like "view:viewId".  \r
         */\r
        removeCommands : function(definitions, focusablePartId){\r
                var crtDefs = this.getDefinitions();\r