]> git.argeo.org Git - lgpl/argeo-commons.git/blob - security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/UserEditorPrefPane.js
15bd3c088acd3626e09a24a95cd26f6b01952733
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.ria / src / argeo-ria-lib / security / class / org / argeo / security / ria / components / UserEditorPrefPane.js
1 qx.Class.define("org.argeo.security.ria.components.UserEditorPrefPane", {
2
3 extend : org.argeo.security.ria.components.UserEditor,
4 implement : [org.argeo.ria.components.IPreferencePane],
5
6 construct : function(){
7 this.base(arguments);
8 this.setSelfEdition(true);
9 this.initGUI();
10 this.basicGB.setVisibility("excluded");
11 var saveButton = new qx.ui.form.Button("Save", "org.argeo.security.ria/document-save.png");
12 saveButton.addListener("execute", this.saveUser, this);
13 this.buttonGB.add(saveButton);
14 var authService = org.argeo.ria.session.AuthService.getInstance();
15 this.loadUserData(authService.getUser());
16 authService.addListener("changeUser", function(){
17 if(authService.getUser() == "anonymous"){
18 this.clearUserData();
19 }else{
20 this.loadUserData(authService.getUser());
21 }
22 }, this);
23 },
24
25 members : {
26 // IPrefPane Implementation
27 getPrefPane : function(){
28 return new qx.ui.container.Scroll(this);
29 },
30
31 getPrefLabel : function(){
32 return "User data";
33 },
34
35 getPrefIcon : function(){
36 return "org.argeo.security.ria/preferences-users.png";
37 }
38 }
39 });