diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/LectureTable.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/LectureTable.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/LectureTable.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/LectureTable.java new file mode 100644 index 00000000..dc2c93f8 --- /dev/null +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/LectureTable.java @@ -0,0 +1,26 @@ +package org.openslx.dozmod.gui.control.table; + +import org.openslx.bwlp.thrift.iface.LectureSummary; +import org.openslx.dozmod.thrift.UserCache; +import org.openslx.dozmod.util.FormatHelper; + +@SuppressWarnings("serial") +public class LectureTable extends ListTable<LectureSummary> { + + private static String[] columnNames = { "Name", "Verantwortlicher" }; + + public LectureTable() { + super(columnNames); + } + + @Override + protected Object getValueAtInternal(int rowIndex, int columnIndex) { + LectureSummary row = get(rowIndex); + if (columnIndex == 0) + return row.getLectureName(); + if (columnIndex == 1) + return FormatHelper.userName(UserCache.find(row.getOwnerId())); + throw new IndexOutOfBoundsException(); + } + +} |