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;
}
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);
}
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());
}
Aggregations