Search in sources :

Example 66 with DefaultColumnDescriptor

use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project openolat by klemens.

the class StudyBranch3StatisticManager method createColumnDescriptor.

@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
    if (column == 0) {
        return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
    }
    if (headerId != null) {
        Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
        if (translator != null) {
            String newHeaderId = translator.translate("swissEduPersonStudyBranch3." + headerId);
            if (newHeaderId != null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
                headerId = newHeaderId;
            }
        }
    }
    TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
    cd.setTranslateHeaderKey(false);
    return cd;
}
Also used : Translator(org.olat.core.gui.translator.Translator) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 67 with DefaultColumnDescriptor

use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project openolat by klemens.

the class QTI12ResultDetailsController method init.

private void init(UserRequest ureq) {
    main = createVelocityContainer("qtires");
    boolean hasEssay = checkEssay();
    main.contextPut("warningEssay", Boolean.valueOf(hasEssay));
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
    tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("column.header.date", 0, null, ureq.getLocale()));
    DefaultColumnDescriptor durationCol = new DefaultColumnDescriptor("column.header.duration", 1, null, ureq.getLocale());
    durationCol.setEscapeHtml(EscapeMode.none);
    tableCtr.addColumnDescriptor(durationCol);
    DefaultColumnDescriptor pointCol = new DefaultColumnDescriptor("column.header.assesspoints", 2, null, ureq.getLocale());
    pointCol.setEscapeHtml(EscapeMode.none);
    tableCtr.addColumnDescriptor(pointCol);
    tableCtr.addColumnDescriptor(new QTISelectColumnDescriptor("column.header.action", 3, coachCourseEnv.isCourseReadOnly(), getLocale(), getTranslator()));
    List<QTIResultSet> resultSets = qrm.getResultSets(courseResourceableId, nodeIdent, repositoryEntry.getKey(), assessedIdentity);
    tableModel = new QTIResultTableModel(resultSets, qtiPersister, getTranslator());
    tableCtr.setTableDataModel(tableModel);
    listenTo(tableCtr);
    main.put("qtirestable", tableCtr.getInitialComponent());
    putInitialPanel(main);
}
Also used : TableController(org.olat.core.gui.components.table.TableController) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 68 with DefaultColumnDescriptor

use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project openolat by klemens.

the class LTIResultDetailsController method init.

protected void init(UserRequest ureq) {
    TableGuiConfiguration summaryTableConfig = new TableGuiConfiguration();
    summaryTableConfig.setDownloadOffered(true);
    summaryTableCtr = new TableController(summaryTableConfig, ureq, getWindowControl(), getTranslator());
    summaryTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.date", 0, null, ureq.getLocale()));
    summaryTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.action", 1, null, ureq.getLocale()));
    summaryTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.key", 2, null, ureq.getLocale()));
    summaryTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.value", 3, null, ureq.getLocale()));
    List<LTIOutcome> outcomes = ltiManager.loadOutcomes(assessedIdentity, resource, resSubPath);
    summaryTableCtr.setTableDataModel(new OutcomeTableDataModel(outcomes));
    listenTo(summaryTableCtr);
    putInitialPanel(summaryTableCtr.getInitialComponent());
}
Also used : TableController(org.olat.core.gui.components.table.TableController) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) LTIOutcome(org.olat.ims.lti.LTIOutcome) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Aggregations

DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)68 TableController (org.olat.core.gui.components.table.TableController)38 TableGuiConfiguration (org.olat.core.gui.components.table.TableGuiConfiguration)38 CustomRenderColumnDescriptor (org.olat.core.gui.components.table.CustomRenderColumnDescriptor)18 StaticColumnDescriptor (org.olat.core.gui.components.table.StaticColumnDescriptor)18 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)13 BooleanColumnDescriptor (org.olat.core.gui.components.table.BooleanColumnDescriptor)10 TotalAwareColumnDescriptor (org.olat.course.statistic.TotalAwareColumnDescriptor)10 Date (java.util.Date)8 ColumnDescriptor (org.olat.core.gui.components.table.ColumnDescriptor)8 Translator (org.olat.core.gui.translator.Translator)6 OnlineIconRenderer (org.olat.group.ui.main.OnlineIconRenderer)6 ArrayList (java.util.ArrayList)4 Locale (java.util.Locale)4 Renderer (org.olat.core.gui.render.Renderer)4 StringOutput (org.olat.core.gui.render.StringOutput)4 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)4 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)4 BigDecimal (java.math.BigDecimal)2 DateFormat (java.text.DateFormat)2