Search in sources :

Example 71 with BooleanCellRenderer

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

the class SelectTestOrSurveyController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.node, new IndentedNodeRenderer()));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.action.select", Cols.select.ordinal(), "select", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.action.select"), "select"), null)));
    tableModel = new NodeTableDataModel(nodes, tableColumnModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "nodeList", tableModel, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(false);
}
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) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 72 with BooleanCellRenderer

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

the class QTI21AssessmentDetailsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.terminationTime));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.lastModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.duration, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.numOfItemSessions, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.responded, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.corrected, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.score, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.manualScore, new TextFlexiCellRenderer(EscapeMode.none)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.finalScore, new TextFlexiCellRenderer(EscapeMode.none)));
    if (readOnly) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", translate("select"), "open"));
    } else {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.open.i18nHeaderKey(), TSCols.open.ordinal(), "open", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("results.report"), "open"), new StaticFlexiCellRenderer(translate("pull"), "open"))));
    }
    if (manualCorrections && !readOnly) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TSCols.correction.i18nHeaderKey(), TSCols.correction.ordinal(), "correction", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("correction"), "correction"), null)));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("download.log", translate("download.log"), "log"));
    tableModel = new QTI21AssessmentTestSessionTableModel(columnsModel, getTranslator());
    tableEl = uifactory.addTableElement(getWindowControl(), "sessions", tableModel, 20, false, getTranslator(), formLayout);
    tableEl.setEmtpyTableMessageKey("results.empty");
    if (reSecurity.isEntryAdmin() && !readOnly) {
        resetButton = uifactory.addFormLink("menu.reset.title", formLayout, Link.BUTTON);
        resetButton.setIconLeftCSS("o_icon o_icon_delete_item");
    }
}
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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) 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