summaryrefslogtreecommitdiff
path: root/webapps/swat/source/class/swat/module/netmgr/UsersView.js
blob: b1b16b61bd665589bf70247d8389d22efeb7698d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Copyright (C)  Rafal Szczesniak 2007
 */

//qx.OO.addProperty({ name: "_fsm", type: "object"});
//qx.OO.addProperty({ name: "_columns", type: "object"});
//qx.OO.addProperty({ name: "_items", type: "object"});
//qx.OO.addProperty({ name: "_view", type: "object" });

/**
 * Users View 
 */
qx.OO.defineClass("swat.module.netmgr.UsersView", qx.ui.layout.HorizontalBoxLayout,
function(fsm)
{
  qx.ui.layout.HorizontalBoxLayout.call(this);

  this._fsm = fsm;
  
  // Set the whole view panel size and spacing between boxes
  this.set({ top: 0, left: 0, width: "100%", height: "100%" });
  this.setSpacing(5);

  // Provide vertical positioning of combo box and list view
  var innerBox = new qx.ui.layout.VerticalBoxLayout();
  innerBox.set({ top: 0, left: 0, width: "100%", height: "100%"});

  // horizontal box for domain selection label and combo box
  var selectDomainBox = new qx.ui.layout.HorizontalBoxLayout();
  selectDomainBox.set({ top: 0, left: 0, width: "auto", height: "10%" });
  selectDomainBox.setVerticalChildrenAlign("middle");
  selectDomainBox.setSpacing(5);
  
  // Setup domain selection combo box
  var lblDomain = new qx.ui.basic.Atom("Domain:");
  lblDomain.setHorizontalChildrenAlign("right");
  
  var cmbDomain = new qx.ui.form.ComboBox();
  cmbDomain.setEditable(false);

  // Create an empty list view with sample column
  this._columns = { username : { label: "Username", width: 150, type: "text" }};
  this._items = [];
  this._view = new qx.ui.listview.ListView(this._items, this._columns);
  var view = this._view;
  view.set({ top: 0, left: 0, width: "90%", height: "90%" });
  view.setBorder(qx.renderer.border.BorderPresets.getInstance().shadow);

  // Arrange widgets and boxes
  selectDomainBox.add(lblDomain);
  selectDomainBox.add(cmbDomain);

  innerBox.add(selectDomainBox);
  innerBox.add(view);

  // place the inner box in the UsersView box
  this.add(innerBox);
});


// UsrMgr context is required for any operation on user accounts
qx.OO.addProperty({ name : "usrCtx", type : "number" });