if(!definition.command){\r
command = new org.argeo.ria.event.Command(key, definition.label, definition.icon, definition.shortcut);\r
if(definition.submenu){\r
- var menu = new qx.ui.menu.Menu();\r
- command.setMenu(menu);\r
+ command.setMenu(definition.submenu);\r
if(definition.submenuCallback){\r
command.setMenuCallback(definition.submenuCallback);\r
command.setMenuContext((definition.callbackContext?definition.callbackContext:null));\r
}\r
command.setEnabled(definition.enabled);\r
command.addListener("execute", definition.callback, (definition.callbackContext?definition.callbackContext:this));\r
+ if(definition.init){\r
+ var binded = qx.lang.Function.bind(definition.init, command);\r
+ binded();\r
+ }\r
definition.command = command;\r
}else{\r
command = definition.command;\r