use of com.extjs.gxt.ui.client.data.MemoryProxy in project kapua by eclipse.
the class UserManageForm method onRender.
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
//
// Permission tab
//
FormLayout permissionsLayout = new FormLayout();
permissionsLayout.setLabelWidth(Constants.LABEL_WIDTH_FORM);
permissionsFieldSet = new FieldSet();
permissionsFieldSet.setBorders(false);
permissionsFieldSet.setLayout(permissionsLayout);
// permissions table columns
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<GwtUserPermission> sm = new CheckBoxSelectionModel<GwtUserPermission>();
configs.add(sm.getColumn());
ColumnConfig column = new ColumnConfig("accountPermission", MSGS.userPermissionsPermissionName(), 270);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
// Permissions table
m_columnModel = new ColumnModel(configs);
//
// Initial empty values
List<GwtUserPermission> gwtUserPermissions = GwtUserPermission.getAllPermissions(m_accountId);
MemoryProxy<List<GwtUserPermission>> proxy = new MemoryProxy<List<GwtUserPermission>>(gwtUserPermissions);
ListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy);
ListStore<GwtUserPermission> permissions = new ListStore<GwtUserPermission>(loader);
loader.load();
// Grid
m_permisssionGrid = new EditorGrid<GwtUserPermission>(permissions, m_columnModel);
m_permisssionGrid.setBorders(true);
m_permisssionGrid.setStripeRows(true);
m_permisssionGrid.getView().setAutoFill(true);
m_permisssionGrid.setWidth(440);
m_permisssionGrid.setHeight(374);
m_permisssionGrid.setAutoExpandColumn("accountPermission");
m_permisssionGrid.setSelectionModel(sm);
m_permisssionGrid.addPlugin(sm);
LabelField permissionsField = new LabelField();
permissionsField.setFieldLabel(MSGS.userFormPermissions());
permissionsFieldSet.add(permissionsField, formData);
permissionsFieldSet.add(m_permisssionGrid, formData);
m_tabUserPermission = new TabItem(MSGS.userFormAccess());
m_tabUserPermission.setBorders(false);
m_tabUserPermission.setStyleAttribute("background-color", "#E8E8E8");
m_tabUserPermission.setScrollMode(Scroll.AUTOY);
m_tabUserPermission.add(permissionsFieldSet);
m_tabUserPermission.setLayout(new FitLayout());
m_tabsPanel.add(m_tabUserPermission);
add(m_formPanel);
}
Aggregations