Search in sources :

Example 1 with LectureBlockStatusCellRenderer

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));
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) TimeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) SortKey(org.olat.core.commons.persistence.SortKey) LectureBlockStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 2 with LectureBlockStatusCellRenderer

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));
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) TimeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) SortKey(org.olat.core.commons.persistence.SortKey) LectureBlockStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

SortKey (org.olat.core.commons.persistence.SortKey)2 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)2 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)2 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)2 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)2 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)2 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)2 TimeFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer)2 LectureBlockStatusCellRenderer (org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer)2