use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class ENRunController method createTableController.
private TableController createTableController(UserRequest ureq, boolean hasAnyWaitingList) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("grouplist.no.groups"));
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
listenTo(tableCtr);
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("grouplist.table.name", 0, CMD_VISIT_CARD, getLocale()));
DefaultColumnDescriptor descCd = new DefaultColumnDescriptor("grouplist.table.desc", 1, null, getLocale());
descCd.setEscapeHtml(EscapeMode.antisamy);
tableCtr.addColumnDescriptor(descCd);
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("grouplist.table.partipiciant", 2, null, getLocale()) {
@Override
public int compareTo(int rowa, int rowb) {
Object a = table.getTableDataModel().getValueAt(rowa, dataColumn);
Object b = table.getTableDataModel().getValueAt(rowb, dataColumn);
if (a == null || b == null) {
boolean bb = (b == null);
return (a == null) ? (bb ? 0 : -1) : (bb ? 1 : 0);
}
try {
Integer la, lb;
if (a instanceof String) {
String sa = (String) a;
la = Integer.parseInt(sa.substring(0, sa.indexOf("/")));
} else {
la = (Integer) a;
}
if (b instanceof String) {
String sb = (String) b;
lb = Integer.parseInt(sb.substring(0, sb.indexOf("/")));
} else {
lb = (Integer) b;
}
return la.compareTo(lb);
} catch (NumberFormatException e) {
return super.compareTo(rowa, rowb);
}
}
});
tableCtr.addColumnDescriptor(hasAnyWaitingList, new DefaultColumnDescriptor("grouplist.table.waitingList", 3, null, getLocale()));
DefaultColumnDescriptor stateColdEsc = new DefaultColumnDescriptor("grouplist.table.state", 4, null, getLocale());
stateColdEsc.setEscapeHtml(EscapeMode.none);
tableCtr.addColumnDescriptor(stateColdEsc);
String enrollCmd = userCourseEnv.isCourseReadOnly() ? null : CMD_ENROLL_IN_GROUP;
BooleanColumnDescriptor columnDesc = new BooleanColumnDescriptor("grouplist.table.enroll", 5, enrollCmd, translate(CMD_ENROLL_IN_GROUP), translate("grouplist.table.no_action"));
columnDesc.setSortingAllowed(false);
tableCtr.addColumnDescriptor(columnDesc);
String cancelCmd = userCourseEnv.isCourseReadOnly() ? null : CMD_ENROLLED_CANCEL;
tableCtr.addColumnDescriptor(new BooleanColumnDescriptor("grouplist.table.cancel_enroll", 6, cancelCmd, translate(CMD_ENROLLED_CANCEL), translate("grouplist.table.no_action")));
return tableCtr;
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
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());
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class MediaFilesTableModel method addColumnDescriptors.
public void addColumnDescriptors(TableController tableCtr) {
tableCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.filename", 0, WikiMainController.ACTION_SHOW_MEDIA, getLocale(), 1, new StrikeThroughCellRenderer()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.created.by", 1, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.creation.date", 2, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.deleted.by", 3, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.deleted.at", 4, null, getLocale()));
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class HistoryTableDateModel method addColumnDescriptors.
public void addColumnDescriptors(TableController tableCtr) {
Locale loc = trans.getLocale();
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.version", 0, WikiMainController.ACTION_SHOW, loc));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.date", 1, null, loc));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.viewcount", 2, null, loc));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.author", 3, null, loc));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.compare", 4, WikiMainController.ACTION_COMPARE, loc));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.comment", 5, null, loc));
}
Aggregations