use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project OpenOLAT by OpenOLAT.
the class AbstractPageListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
timelineEl = new TimelineElement("timeline");
timelineEl.setContainerId("o_portfolio_entries_timeline_" + timelineEl.getComponent().getDispatchID());
formLayout.add("timeline", timelineEl);
initTimeline();
if (portfolioV2Module.isEntriesTimelineEnabled() && config.isTimeline()) {
timelineSwitchOnButton = uifactory.addFormLink("timeline.switch.on", formLayout, Link.BUTTON_SMALL);
timelineSwitchOnButton.setIconLeftCSS("o_icon o_icon-sm o_icon_toggle_on");
timelineSwitchOnButton.setElementCssClass("o_sel_timeline_on");
timelineSwitchOffButton = uifactory.addFormLink("timeline.switch.off", formLayout, Link.BUTTON_SMALL);
timelineSwitchOffButton.setIconLeftCSS("o_icon o_icon-sm o_icon_toggle_off");
timelineSwitchOffButton.setElementCssClass("o_sel_timeline_off");
doSwitchTimelineOn();
} else {
flc.contextPut("timelineSwitch", Boolean.FALSE);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, PageCols.key, "select-page"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.title, "select-page", new PortfolioElementCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.date, "select-page"));
if (secCallback.canPageUserInfosStatus()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.viewerStatus, new SharedPageStatusCellRenderer(getTranslator())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.pageStatus, new StatusCellRenderer(getTranslator())));
} else {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.status, new StatusCellRenderer(getTranslator())));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.publicationDate, "select-page"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.categories, new CategoriesCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, PageCols.section, /*, "select-section"*/
null));
if (secCallback.canNewAssignment()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.up", PageCols.up.ordinal(), "up", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("up"), "up"), null)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.down", PageCols.down.ordinal(), "down", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("down"), "down"), null)));
}
if (!secCallback.canNewAssignment()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PageCols.comment));
}
model = new PageListDataModel(columnsModel, getLocale());
String mapperThumbnailUrl = registerCacheableMapper(ureq, "page-list", new PageImageMapper(model, portfolioService));
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
if (portfolioV2Module.isEntriesListEnabled() && portfolioV2Module.isEntriesTableEnabled()) {
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom, FlexiTableRendererType.classic);
} else if (portfolioV2Module.isEntriesTableEnabled()) {
tableEl.setAvailableRendererTypes(FlexiTableRendererType.classic);
} else {
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
}
tableEl.setSearchEnabled(portfolioV2Module.isEntriesSearchEnabled());
tableEl.setCustomizeColumns(true);
tableEl.setElementCssClass("o_binder_page_listing");
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
tableEl.setPageSize(24);
// sets its own DOM id in velocity container
rowVC.setDomReplacementWrapperRequired(false);
rowVC.contextPut("mapperThumbnailUrl", mapperThumbnailUrl);
tableEl.setRowRenderer(rowVC, this);
tableEl.setCssDelegate(new DefaultFlexiTableCssDelegate());
tableEl.setAndLoadPersistedPreferences(ureq, "page-list");
FlexiTableRendererType renderType = portfolioV2Module.isEntriesListEnabled() ? FlexiTableRendererType.custom : FlexiTableRendererType.classic;
tableEl.setRendererType(renderType);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project OpenOLAT by OpenOLAT.
the class ParticipantLectureBlocksController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
if (withPrint) {
layoutCont.contextPut("winid", "w" + layoutCont.getFormItemComponent().getDispatchID());
layoutCont.getFormItemComponent().addListener(this);
layoutCont.getFormItemComponent().contextPut("withPrint", Boolean.TRUE);
layoutCont.contextPut("title", StringHelper.escapeHtml(entry.getDisplayname()));
openCourseButton = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
openCourseButton.setIconLeftCSS("o_icon o_CourseModule_icon");
} else {
layoutCont.contextPut("title", translate("lectures.repository.print.title", new String[] { StringHelper.escapeHtml(entry.getDisplayname()), StringHelper.escapeHtml(userManager.getUserDisplayName(assessedIdentity)) }));
}
layoutCont.contextPut("authorizedAbsenceEnabled", authorizedAbsenceEnabled);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.entry));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.coach));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.plannedLectures, new LecturesCompulsoryRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.attendedLectures));
if (authorizedAbsenceEnabled) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.unauthorizedAbsentLectures));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.authorizedAbsentLectures));
} else {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.absentLectures));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.status, new LectureBlockRollCallStatusCellRenderer(authorizedAbsenceEnabled, absenceDefaultAuthorized, getTranslator())));
if (appealEnabled && withAppeal && assessedIdentity.equals(getIdentity())) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("appeal", ParticipantCols.appeal.ordinal(), "appeal", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("appeal"), "appeal"), null)));
}
tableModel = new ParticipantLectureBlocksDataModel(columnsModel, authorizedAbsenceEnabled, absenceDefaultAuthorized, getLocale());
int paging = withPrint ? 20 : -1;
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, paging, false, getTranslator(), formLayout);
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setDefaultOrderBy(new SortKey(ParticipantCols.date.name(), true));
tableEl.setSortSettings(options);
tableEl.setCustomizeColumns(withPrint);
tableEl.setAndLoadPersistedPreferences(ureq, "participant-roll-call-appeal");
tableEl.setEmtpyTableMessageKey("empty.repository.entry.lectures");
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
filters.add(new FlexiTableFilter(translate("filter.mandatory"), "mandatory"));
tableEl.setFilters("", filters, false);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project OpenOLAT by OpenOLAT.
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);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project OpenOLAT by OpenOLAT.
the class AbstractItemListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("quickview", "<i class='o_icon o_icon_quickview'> </i>", "quick-view"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.mark.i18nKey(), Cols.mark.ordinal(), true, OrderBy.marks.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.editable.i18nKey(), Cols.editable.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.identifier.i18nKey(), Cols.identifier.ordinal(), true, OrderBy.identifier.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.title.i18nKey(), Cols.title.ordinal(), true, OrderBy.title.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.topic.i18nKey(), Cols.topic.ordinal(), true, OrderBy.topic.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.creationDate.i18nKey(), Cols.creationDate.ordinal(), true, OrderBy.creationDate.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lastModified.i18nKey(), Cols.lastModified.ordinal(), true, OrderBy.lastModified.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.keywords.i18nKey(), Cols.keywords.ordinal(), true, OrderBy.keywords.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.coverage.i18nKey(), Cols.coverage.ordinal(), true, OrderBy.coverage.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.additionalInfos.i18nKey(), Cols.additionalInfos.ordinal(), true, OrderBy.additionalInformations.name()));
if (getSecurityCallback().canUseTaxonomy()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxnonomyLevel.i18nKey(), Cols.taxnonomyLevel.ordinal(), true, OrderBy.taxonomyLevel.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxnonomyPath.i18nKey(), Cols.taxnonomyPath.ordinal(), true, OrderBy.taxonomyPath.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.difficulty.i18nKey(), Cols.difficulty.ordinal(), true, OrderBy.difficulty.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.stdevDifficulty.i18nKey(), Cols.stdevDifficulty.ordinal(), true, OrderBy.stdevDifficulty.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.differentiation.i18nKey(), Cols.differentiation.ordinal(), true, OrderBy.differentiation.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.numOfAnswerAlternatives.i18nKey(), Cols.numOfAnswerAlternatives.ordinal(), true, OrderBy.numOfAnswerAlternatives.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.usage.i18nKey(), Cols.usage.ordinal(), true, OrderBy.usage.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.type.i18nKey(), Cols.type.ordinal(), true, OrderBy.itemType.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.format.i18nKey(), Cols.format.ordinal(), true, OrderBy.format.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.rating.i18nKey(), Cols.rating.ordinal(), true, OrderBy.rating.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.numberOfRatings.i18nKey(), Cols.numberOfRatings.ordinal(), true, OrderBy.numberOfRatings.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.itemVersion.i18nKey(), Cols.itemVersion.ordinal(), true, OrderBy.itemVersion.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.status.i18nKey(), Cols.status.ordinal(), true, OrderBy.status.name(), new QuestionStatusCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.statusLastModified.i18nKey(), Cols.statusLastModified.ordinal(), true, OrderBy.statusLastModified.name()));
if (licenseModule.isEnabled(licenseHandler)) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, false, Cols.license.i18nKey(), Cols.license.ordinal(), "license", false, null, FlexiColumnModel.ALIGNMENT_LEFT, new StaticFlexiCellRenderer("license", new LicenseRenderer(getLocale()))));
}
initActionColumns(columnsModel);
model = new QuestionItemDataModel(columnsModel, this, getTranslator());
itemsTable = uifactory.addTableElement(getWindowControl(), "items", model, 50, false, getTranslator(), formLayout);
itemsTable.setWrapperSelector("qitems");
itemsTable.setSelectAllEnable(true);
itemsTable.setMultiSelect(true);
itemsTable.setSearchEnabled(true);
itemsTable.setSortSettings(new FlexiTableSortOptions(true));
itemsTable.setExtendedSearch(extendedSearchCtrl);
itemsTable.setColumnIndexForDragAndDropLabel(Cols.title.ordinal());
itemsTable.setAndLoadPersistedPreferences(ureq, "qpool-list-" + prefsKey);
listenTo(extendedSearchCtrl);
VelocityContainer detailsVC = createVelocityContainer("item_list_details");
itemsTable.setDetailsRenderer(detailsVC, this);
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(OrderBy.title.name(), true));
itemsTable.setSortSettings(sortOptions);
initButtons(ureq, formLayout);
itemsTable.reloadData();
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer in project OpenOLAT by OpenOLAT.
the class CreateTestOverviewController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "export.overview.accept", Cols.accept.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer("o_icon_accept"), new CSSIconFlexiCellRenderer("o_icon_failed"))));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("general.title", Cols.title.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("technical.format", Cols.format.ordinal()));
itemsModel = new QItemDataModel(columnsModel, format);
uifactory.addTableElement(getWindowControl(), "shares", itemsModel, getTranslator(), formLayout);
FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add("buttons", buttonLayout);
uifactory.addFormSubmitButton("create.test", buttonLayout);
uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
}
Aggregations