summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/UserTable.java
blob: b227916e1201a132a390b2d777fc2ee06ce06514 (plain) (blame)
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
package org.openslx.dozmod.gui.control.table;

import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.dozmod.util.FormatHelper;

@SuppressWarnings("serial")
public class UserTable extends ListTable<UserInfo> {

	public static final ListTableColumn COL_NAME = new ListTableColumn("Name");
	public static final ListTableColumn COL_MAIL = new ListTableColumn("Mail");

	public UserTable() {
		super(COL_NAME, COL_MAIL);
	}

	@Override
	protected Object getValueAtInternal(UserInfo row, ListTableColumn columnIndex) {
		if (columnIndex == COL_NAME)
			return FormatHelper.userName(row);
		if (columnIndex == COL_MAIL)
			return row.eMail;
		throw new IndexOutOfBoundsException();
	}

}