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
\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
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
if(!definition.selectionChange) continue;\r
if(shared[key]){\r
var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus();\r
+ //this.debug(currentFocus);\r
if(!currentFocus) continue;\r
var sharedComm = shared[key][currentFocus.getViewId()];\r
if(sharedComm && sharedComm.selectionChange){\r
/**\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
/**\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
}\r
var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus();\r
if(currentFocus && currentFocus.getViewId() && callbacks[currentFocus.getViewId()]){\r
+ var currentViewId = currentFocus.getViewId();\r
+ view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById(currentViewId).getContent();\r
var binded = qx.lang.Function.bind(callbacks[currentFocus.getViewId()], view);\r
binded(event);\r
return;\r