3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.account
.user
.view
;
13 import java
.util
.List
;
15 import org
.eclipse
.jface
.viewers
.IBaseLabelProvider
;
16 import org
.eclipse
.jface
.viewers
.TableViewer
;
17 import org
.eclipse
.jface
.viewers
.TableViewerColumn
;
18 import org
.eclipse
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Table
;
21 import eu
.etaxonomy
.cdm
.api
.service
.IUserService
;
22 import eu
.etaxonomy
.cdm
.model
.common
.User
;
23 import eu
.etaxonomy
.taxeditor
.account
.AbstractAccountView
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * <p>UserManagerView class.</p>
33 public class UserView
extends AbstractAccountView
<User
>{
36 /** Constant <code>ID="eu.etaxonomy.taxeditor.store.userManage"{trunked}</code> */
37 public static String ID
= "eu.etaxonomy.taxeditor.store.userManagerView";
39 // This will create the columns for the table
40 protected void createColumns(TableViewer viewer
) {
41 Table table
= viewer
.getTable();
42 String
[] titles
= {"Active", "Name", "Enabled", "Locked", "Person", "Email"};
43 int[] bounds
= { 20, 200, 50, 50, 200, 100};
45 for (int i
= 0; i
< titles
.length
; i
++) {
46 TableViewerColumn column
= new TableViewerColumn(viewer
, SWT
.NONE
);
47 column
.getColumn().setText(titles
[i
]);
48 column
.getColumn().setWidth(bounds
[i
]);
49 column
.getColumn().setResizable(true);
50 column
.getColumn().setMoveable(true);
52 table
.setHeaderVisible(true);
53 table
.setLinesVisible(true);
61 public List
<User
> getInput(){
62 return CdmStore
.getService(IUserService
.class).list(null, null, null, null, null);
67 * @see eu.etaxonomy.taxeditor.account.AbstractAccountView#getLabelProvider()
70 protected IBaseLabelProvider
getLabelProvider() {
71 return new UserLabelProvider();