Search in sources :

Example 31 with BooleanCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project openolat by klemens.

the class ParticipantLectureBlocksController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        if (withPrint) {
            layoutCont.contextPut("winid", "w" + layoutCont.getFormItemComponent().getDispatchID());
            layoutCont.getFormItemComponent().addListener(this);
            layoutCont.getFormItemComponent().contextPut("withPrint", Boolean.TRUE);
            layoutCont.contextPut("title", StringHelper.escapeHtml(entry.getDisplayname()));
            openCourseButton = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
            openCourseButton.setIconLeftCSS("o_icon o_CourseModule_icon");
        } else {
            layoutCont.contextPut("title", translate("lectures.repository.print.title", new String[] { StringHelper.escapeHtml(entry.getDisplayname()), StringHelper.escapeHtml(userManager.getUserDisplayName(assessedIdentity)) }));
        }
        layoutCont.contextPut("authorizedAbsenceEnabled", authorizedAbsenceEnabled);
    }
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.date, new DateFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.entry));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.lectureBlock));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.coach));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.plannedLectures, new LecturesCompulsoryRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.attendedLectures));
    if (authorizedAbsenceEnabled) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.unauthorizedAbsentLectures));
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.authorizedAbsentLectures));
    } else {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.absentLectures));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.status, new LectureBlockRollCallStatusCellRenderer(authorizedAbsenceEnabled, absenceDefaultAuthorized, getTranslator())));
    if (appealEnabled && withAppeal && assessedIdentity.equals(getIdentity())) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("appeal", ParticipantCols.appeal.ordinal(), "appeal", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("appeal"), "appeal"), null)));
    }
    tableModel = new ParticipantLectureBlocksDataModel(columnsModel, authorizedAbsenceEnabled, absenceDefaultAuthorized, getLocale());
    int paging = withPrint ? 20 : -1;
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, paging, false, getTranslator(), formLayout);
    FlexiTableSortOptions options = new FlexiTableSortOptions();
    options.setDefaultOrderBy(new SortKey(ParticipantCols.date.name(), true));
    tableEl.setSortSettings(options);
    tableEl.setCustomizeColumns(withPrint);
    tableEl.setAndLoadPersistedPreferences(ureq, "participant-roll-call-appeal");
    tableEl.setEmtpyTableMessageKey("empty.repository.entry.lectures");
    List<FlexiTableFilter> filters = new ArrayList<>();
    filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
    filters.add(new FlexiTableFilter(translate("filter.mandatory"), "mandatory"));
    tableEl.setFilters("", filters, false);
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) ArrayList(java.util.ArrayList) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) SortKey(org.olat.core.commons.persistence.SortKey) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) LecturesCompulsoryRenderer(org.olat.modules.lecture.ui.component.LecturesCompulsoryRenderer) LectureBlockRollCallStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockRollCallStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 32 with BooleanCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project openolat by klemens.

the class AbstractStandardBusinessGroupListController method initColumnModel.

@Override
protected FlexiTableColumnModel initColumnModel() {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    // mark
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.mark.i18n(), Cols.mark.ordinal(), true, Cols.mark.name()));
    // group name
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name.i18n(), Cols.name.ordinal(), TABLE_ACTION_LAUNCH, true, Cols.name.name(), new StaticFlexiCellRenderer(TABLE_ACTION_LAUNCH, new BusinessGroupNameCellRenderer())));
    // id and reference
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18n(), Cols.key.ordinal(), true, Cols.key.name()));
    if (groupModule.isManagedBusinessGroups()) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalId.i18n(), Cols.externalId.ordinal(), true, Cols.externalId.name()));
    }
    // description
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.description.i18n(), Cols.description.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new TextFlexiCellRenderer(EscapeMode.antisamy)));
    // courses
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.resources.i18n(), Cols.resources.ordinal(), true, Cols.resources.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGResourcesCellRenderer(flc)));
    // access
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), true, Cols.accessTypes.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGAccessControlledCellRenderer()));
    // launch dates
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.firstTime.i18n(), Cols.firstTime.ordinal(), true, Cols.firstTime.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lastTime.i18n(), Cols.lastTime.ordinal(), true, Cols.lastTime.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lastUsage.i18n(), Cols.lastUsage.ordinal(), true, Cols.lastUsage.name()));
    // roles
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.role.i18n(), Cols.role.ordinal(), true, Cols.role.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGRoleCellRenderer(getLocale())));
    // actions
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.allowLeave.i18n(), Cols.allowLeave.ordinal(), TABLE_ACTION_LEAVE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.leave"), TABLE_ACTION_LEAVE), null)));
    return columnsModel;
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) 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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 33 with BooleanCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project openolat by klemens.

the class BusinessGroupListController method initColumnModel.

@Override
protected FlexiTableColumnModel initColumnModel() {
    FlexiTableColumnModel columnsModel = super.initColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.allowDelete.i18n(), Cols.allowDelete.ordinal(), TABLE_ACTION_DELETE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.delete"), TABLE_ACTION_DELETE), null)));
    return columnsModel;
}
Also used : 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) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 34 with BooleanCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project openolat by klemens.

the class IdentityAssessmentOverviewController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.node, new IndentedNodeRenderer() {

        @Override
        public boolean isIndentationEnabled() {
            return tableEl.getOrderBy() == null || tableEl.getOrderBy().length == 0;
        }
    }));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.attempts));
    if (!followUserResultsVisibility) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.userVisibility, new UserVisibilityCellRenderer(getTranslator())));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.score, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.min, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.max, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.passed, new PassedCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.numOfAssessmentDocs));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.status, new AssessmentStatusCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.lastUserModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastCoachModified));
    if (nodesSelectable) {
        DefaultFlexiColumnModel selectCol = new DefaultFlexiColumnModel("select", NodeCols.select.ordinal(), CMD_SELECT_NODE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("select"), CMD_SELECT_NODE), null));
        selectCol.setExportable(false);
        columnsModel.addFlexiColumnModel(selectCol);
    }
    tableModel = new IdentityAssessmentOverviewTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 250, false, getTranslator(), formLayout);
    tableEl.setExportEnabled(true);
    tableEl.setEmtpyTableMessageKey("nodesoverview.emptylist");
    tableEl.setBordered(true);
    tableEl.setNumOfRowsEnabled(false);
    if (allowTableFiltering) {
        List<FlexiTableFilter> filters = new ArrayList<>();
        filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
        filters.add(FlexiTableFilter.SPACER);
        filters.add(new FlexiTableFilter(translate("filter.passed"), "passed"));
        filters.add(new FlexiTableFilter(translate("filter.failed"), "failed"));
        filters.add(new FlexiTableFilter(translate("filter.inProgress"), "inProgress"));
        filters.add(new FlexiTableFilter(translate("filter.inReview"), "inReview"));
        filters.add(new FlexiTableFilter(translate("filter.done"), "done"));
        tableEl.setFilters("", filters, false);
    }
}
Also used : ArrayList(java.util.ArrayList) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 35 with BooleanCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project openolat by klemens.

the class SubmitDocumentsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (config.getBooleanSafe(GTACourseNode.GTASK_EXTERNAL_EDITOR)) {
        uploadDocButton = uifactory.addFormLink("upload.document", formLayout, Link.BUTTON);
        uploadDocButton.setIconLeftCSS("o_icon o_icon_upload");
        uploadDocButton.setElementCssClass("o_sel_course_gta_submit_file");
        uploadDocButton.setVisible(!readOnly);
    }
    if (config.getBooleanSafe(GTACourseNode.GTASK_EMBBEDED_EDITOR)) {
        createDocButton = uifactory.addFormLink("open.editor", formLayout, Link.BUTTON);
        createDocButton.setIconLeftCSS("o_icon o_icon_edit");
        createDocButton.setElementCssClass("o_sel_course_gta_create_doc");
        createDocButton.setI18nKey(docI18nKey + ".open.editor");
        createDocButton.setVisible(!readOnly);
    }
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(docI18nKey, DocCols.document.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(DocCols.date.i18nKey(), DocCols.date.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(DocCols.uploadedBy.i18nKey(), DocCols.uploadedBy.ordinal()));
    if (!readOnly) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", DocCols.edit.ordinal(), "edit", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("edit"), "edit"), new StaticFlexiCellRenderer(translate("replace"), "edit"))));
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete"));
    }
    model = new DocumentTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, getTranslator(), formLayout);
    formLayout.add("table", tableEl);
    // configure table to be as slim as possible
    tableEl.setCustomizeColumns(false);
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setElementCssClass("o_table_no_margin");
}
Also used : 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) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)72 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)72 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)70 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)56 CSSIconFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer)18 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)14 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)12 SortKey (org.olat.core.commons.persistence.SortKey)10 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)10 FlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer)10 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)8 ArrayList (java.util.ArrayList)6 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)6 IndentedNodeRenderer (org.olat.course.assessment.IndentedNodeRenderer)4 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)4 SharedPageStatusCellRenderer (org.olat.modules.portfolio.ui.renderer.SharedPageStatusCellRenderer)4 StatusCellRenderer (org.olat.modules.portfolio.ui.renderer.StatusCellRenderer)4 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)4 LicenseHandler (org.olat.core.commons.services.license.LicenseHandler)2 LicenseRenderer (org.olat.core.commons.services.license.ui.LicenseRenderer)2