create.addListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
final String userName = Window.prompt(constants.EnterNewUserName(), constants.NewUserName());
if (userName != null) {
RepositoryServiceFactory.getService().updateUserPermissions(userName, new HashMap(), new GenericCallback() {
public void onSuccess(Object a) {
refresh();
showEditor(userName);
}
});
}
}
});
tb.addButton(create);
ToolbarButton delete = new ToolbarButton(constants.DeleteSelectedUser());
delete.addListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
final String userName = grid.getSelectionModel().getSelected().getAsString("userName"); //NON-NLS
if (userName != null && Window.confirm(Format.format(constants.AreYouSureYouWantToDeleteUser0(), userName))) {
RepositoryServiceFactory.getService().deleteUser(userName, new GenericCallback() {
public void onSuccess(Object a) {
refresh();
}
});
}