use of org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer in project OpenOLAT by OpenOLAT.
the class TeacherLecturesTableController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (withRepositoryEntry) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.externalRef, "open.course"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.entry, "open.course"));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.startTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.endTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.location));
if (withTeachers) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.teachers));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.status, new LectureBlockStatusCellRenderer(getTranslator())));
DefaultFlexiColumnModel detailsCol = new DefaultFlexiColumnModel(TeachCols.details.i18nHeaderKey(), TeachCols.details.ordinal(), "details", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.details"), "details"), null));
// set sort key even though we do not sort - added as css classes to column headers for styling
detailsCol.setSortKey(TeachCols.details.name());
columnsModel.addFlexiColumnModel(detailsCol);
DefaultFlexiColumnModel toolsCol = new DefaultFlexiColumnModel(TeachCols.tools);
toolsCol.setSortable(false);
columnsModel.addFlexiColumnModel(toolsCol);
tableModel = new TeacherOverviewDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(TeachCols.date.name(), sortAsc));
tableEl.setSortSettings(sortOptions);
tableEl.setCustomizeColumns(false);
tableEl.setNumOfRowsEnabled(false);
tableEl.setEmtpyTableMessageKey(emptyI18nKey);
tableEl.setAndLoadPersistedPreferences(ureq, "lecture-teacher-overview-".concat(id));
}
use of org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer in project openolat by klemens.
the class TeacherLecturesTableController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (withRepositoryEntry) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.externalRef, "open.course"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.entry, "open.course"));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.startTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.endTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.location));
if (withTeachers) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.teachers));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.status, new LectureBlockStatusCellRenderer(getTranslator())));
DefaultFlexiColumnModel detailsCol = new DefaultFlexiColumnModel(TeachCols.details.i18nHeaderKey(), TeachCols.details.ordinal(), "details", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.details"), "details"), null));
// set sort key even though we do not sort - added as css classes to column headers for styling
detailsCol.setSortKey(TeachCols.details.name());
columnsModel.addFlexiColumnModel(detailsCol);
DefaultFlexiColumnModel toolsCol = new DefaultFlexiColumnModel(TeachCols.tools);
toolsCol.setSortable(false);
columnsModel.addFlexiColumnModel(toolsCol);
tableModel = new TeacherOverviewDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(TeachCols.date.name(), sortAsc));
tableEl.setSortSettings(sortOptions);
tableEl.setCustomizeColumns(false);
tableEl.setNumOfRowsEnabled(false);
tableEl.setEmtpyTableMessageKey(emptyI18nKey);
tableEl.setAndLoadPersistedPreferences(ureq, "lecture-teacher-overview-".concat(id));
}
Aggregations