X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ria%2Fsrc%2Fargeo-ria-lib%2Fsecurity%2Fclass%2Forg%2Fargeo%2Fsecurity%2Fria%2FUsersApplet.js;h=a44d3bb06bcc1edf50c28d3464bc074e24cf6c6f;hb=887773721e5ce1aabbd45b8fc1278ffcf6bb25f8;hp=5eb44f42ed1b0feee5ebb76d97d51a8f3d74ebfb;hpb=829163c2a8aa042407a6fd2ee45d10cea69e933f;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js index 5eb44f42e..a44d3bb06 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js @@ -34,7 +34,7 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", shortcut : "Control+n", enabled : true, menu : "Users", - toolbar : "userslist", + toolbar : null, callback : function(e){ // Call service to delete var classObj = org.argeo.security.ria.UserEditorApplet; @@ -49,7 +49,7 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", shortcut : "Control+s", enabled : true, menu : "Users", - toolbar : "userslist", + toolbar : null, callback : function(e){ // Call service to delete var crtUsers = this.getViewSelection().getNodes(); @@ -69,7 +69,7 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", shortcut : "Control+u", enabled : true, menu : "Users", - toolbar : "userslist", + toolbar : null, callback : function(e){ // Call service to delete var crtUser = this.getViewSelection().getNodes()[0]; @@ -107,7 +107,13 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", */ init : function(viewPane){ this.setView(viewPane); - this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + + this.toolBar = new qx.ui.toolbar.ToolBar(); + this.toolBarPart = new qx.ui.toolbar.Part(); + this.toolBar.add(this.toolBarPart); + viewPane.add(this.toolBar); + this.tableModel = new qx.ui.table.model.Filtered(); this.tableModel.setColumns(["username", "roles"]); this.table = new qx.ui.table.Table(this.tableModel, { @@ -123,6 +129,9 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", this.table.getSelectionModel().addListener("changeSelection", function(){ this._selectionToValues(this.table.getSelectionModel(), this.getViewSelection()); }, this); + this.table.addListener("cellDblclick", function(cellEvent){ + this.getCommands()["edit_user"].command.execute(); + }, this); this.setGuiMode("chooser"); }, @@ -168,6 +177,12 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", load : function(){ var data = [["root", "ROLE_ADMIN"], ["mbaudier", "ROLE_ADMIN,ROLE_USER"], ["cdujeu","ROLE_USER"], ["anonymous", ""]]; this.tableModel.setData(data); + var commands = this.getCommands(); + this.toolBarPart.add(commands["new_user"].command.getToolbarButton()); + this.toolBarPart.add(commands["delete_user"].command.getToolbarButton()); + this.toolBarPart.add(commands["edit_user"].command.getToolbarButton()); + this.toolBar.setShow("icon"); + }, applySelection : function(selectionValues, target){