use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class AssessmentModeListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
addLink = uifactory.addFormLink("add", "add", "add.mode", null, formLayout, Link.BUTTON);
addLink.setElementCssClass("o_sel_assessment_mode_add");
addLink.setIconLeftCSS("o_icon o_icon_add");
deleteLink = uifactory.addFormLink("delete", "delete", "delete.mode", null, formLayout, Link.BUTTON);
deleteLink.setIconLeftCSS("o_icon o_icon_delete");
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.status.i18nKey(), Cols.status.ordinal(), true, Cols.status.name(), new ModeStatusCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name.i18nKey(), Cols.name.ordinal(), true, Cols.name.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.begin.i18nKey(), Cols.begin.ordinal(), true, Cols.begin.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.end.i18nKey(), Cols.end.ordinal(), true, Cols.end.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.leadTime.i18nKey(), Cols.leadTime.ordinal(), true, Cols.leadTime.name(), new TimeCellRenderer(getTranslator())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.followupTime.i18nKey(), Cols.followupTime.ordinal(), true, Cols.followupTime.name(), new TimeCellRenderer(getTranslator())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.target.i18nKey(), Cols.target.ordinal(), true, Cols.target.name(), new TargetAudienceCellRenderer(getTranslator())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("start", Cols.start.ordinal(), "start", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("start"), "start"), null)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("stop", Cols.stop.ordinal(), "stop", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("stop"), "stop"), null)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", translate("edit"), "edit"));
model = new AssessmentModeListModel(columnsModel, getTranslator(), assessmentModeCoordinationService);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setMultiSelect(true);
tableEl.setSelectAllEnable(true);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class AssessmentModeOverviewListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.status, new ModeStatusCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.name));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.begin));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.end));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.leadTime, new TimeCellRenderer(getTranslator())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ModeCols.followupTime, new TimeCellRenderer(getTranslator())));
model = new AssessmentModeOverviewListTableModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 10, false, getTranslator(), formLayout);
tableEl.setCustomizeColumns(false);
tableEl.setNumOfRowsEnabled(false);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class CertificatesListAdminController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name.i18n(), Cols.name.ordinal()));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("replace", translate("replace"), "replace"));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete"));
tableModel = new TemplatesDataModel(tableColumnModel);
tableEl = uifactory.addTableElement(getWindowControl(), "templates", tableModel, getTranslator(), formLayout);
uploadLink = uifactory.addFormLink("upload", formLayout, Link.BUTTON);
updateDataModel();
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class CertificatesSelectionController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
;
int colPos = 0;
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.name", CertificatesSelectionDataModel.USERNAME_COL));
}
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(AssessedIdentitiesTableDataModel.usageIdentifyer, isAdministrativeUser);
List<UserPropertyHandler> resultingPropertyHandlers = new ArrayList<UserPropertyHandler>();
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = userManager.isMandatoryUserProperty(AssessedIdentitiesTableDataModel.usageIdentifyer, userPropertyHandler);
resultingPropertyHandlers.add(userPropertyHandler);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(visible, userPropertyHandler.i18nColumnDescriptorLabelKey(), colPos++, false, null));
}
if (hasAssessableNodes) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.passed", CertificatesSelectionDataModel.PASSED_COL, new PassedCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.score", CertificatesSelectionDataModel.SCORE_COL));
}
tableModel = new CertificatesSelectionDataModel(columnsModel, resultingPropertyHandlers);
Set<Integer> preselectedRows = new HashSet<>();
ICourse course = CourseFactory.loadCourse(courseEntry);
CourseNode rootNode = course.getRunStructure().getRootNode();
List<CertificateInfos> infos = new ArrayList<>(datas.size());
int count = 0;
for (AssessedIdentityWrapper data : datas) {
ScoreEvaluation scoreEval = data.getUserCourseEnvironment().getScoreAccounting().getScoreEvaluation(rootNode);
Float score = scoreEval == null ? null : scoreEval.getScore();
Boolean passed = scoreEval == null ? null : scoreEval.getPassed();
Identity assessedIdentity = data.getIdentity();
infos.add(new CertificateInfos(assessedIdentity, score, passed));
if (passed != null && passed.booleanValue()) {
preselectedRows.add(new Integer(count));
}
count++;
}
tableModel.setObjects(infos);
tableEl = uifactory.addTableElement(getWindowControl(), "selection", tableModel, getTranslator(), formLayout);
tableEl.setMultiSelect(true);
tableEl.setSelectAllEnable(true);
tableEl.setMultiSelectedIndex(preselectedRows);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class HibernateEntitiesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.entity.i18nKey(), EntityCols.entity.ordinal(), true, EntityCols.entity.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.load.i18nKey(), EntityCols.load.ordinal(), true, EntityCols.load.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.fetch.i18nKey(), EntityCols.fetch.ordinal(), true, EntityCols.fetch.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.insert.i18nKey(), EntityCols.insert.ordinal(), true, EntityCols.insert.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.update.i18nKey(), EntityCols.update.ordinal(), true, EntityCols.update.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.delete.i18nKey(), EntityCols.delete.ordinal(), true, EntityCols.delete.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.optimisticFailure.i18nKey(), EntityCols.optimisticFailure.ordinal(), true, EntityCols.optimisticFailure.name()));
tableModel = new EntityStatisticsDataModel(columnsModel);
table = uifactory.addTableElement(getWindowControl(), "entities", tableModel, 50, true, getTranslator(), formLayout);
table.setAndLoadPersistedPreferences(ureq, "HibernateEntityStatistics");
table.setExportEnabled(true);
table.setPageSize(250);
}
Aggregations