use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class BinderListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, PortfolioCols.key, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(PortfolioCols.title, "select"));
model = new BindersDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
tableEl.setRendererType(FlexiTableRendererType.custom);
tableEl.setSearchEnabled(false);
tableEl.setCustomizeColumns(false);
tableEl.setElementCssClass("o_portfolio_listing");
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
tableEl.setNumOfRowsEnabled(false);
tableEl.setPageSize(24);
VelocityContainer row = createVelocityContainer("binder_row");
// sets its own DOM id in velocity container
row.setDomReplacementWrapperRequired(false);
tableEl.setRowRenderer(row, this);
tableEl.setCssDelegate(new BinderCssDelegate());
tableEl.setAndLoadPersistedPreferences(ureq, getTableId());
mapperThumbnailUrl = registerCacheableMapper(ureq, "binder-list", new ImageMapper(model));
row.contextPut("mapperThumbnailUrl", mapperThumbnailUrl);
if (!portfolioModule.isLearnerCanCreateBinders() && !portfolioModule.isCanCreateBindersFromTemplate() && portfolioModule.isCanCreateBindersFromCourse()) {
newBinderFromCourseButton = uifactory.addFormLink("create.binder.from.course", "create.empty.binder.from.course", null, formLayout, Link.BUTTON);
row.put("createBinderFromCourse", newBinderFromCourseButton.getComponent());
} else if (portfolioModule.isLearnerCanCreateBinders() || portfolioModule.isCanCreateBindersFromTemplate() || portfolioModule.isCanCreateBindersFromCourse()) {
newBinderDropdown = uifactory.addFormLink("create.binders", "create.new.binder", null, formLayout, Link.BUTTON);
int count = (portfolioModule.isLearnerCanCreateBinders() ? 1 : 0) + (portfolioModule.isCanCreateBindersFromTemplate() ? 1 : 0) + (portfolioModule.isCanCreateBindersFromCourse() ? 1 : 0);
if (count > 1) {
newBinderDropdown.setIconRightCSS("o_icon o_icon_caret");
}
row.put("createDropdown", newBinderDropdown.getComponent());
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class MediaCenterController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (select) {
newMediaCallout = uifactory.addFormLink("new.medias", formLayout, Link.BUTTON);
newMediaCallout.setIconRightCSS("o_icon o_icon_caret o_icon-fw");
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, MediaCols.key, "select"));
Map<String, MediaHandler> handlersMap = portfolioService.getMediaHandlers().stream().collect(Collectors.toMap(h -> h.getType(), h -> h));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MediaCols.type, new MediaTypeCellRenderer(handlersMap)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MediaCols.title, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MediaCols.collectionDate, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MediaCols.categories, new CategoriesCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", translate("select"), "select"));
model = new MediaDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom, FlexiTableRendererType.classic);
tableEl.setRendererType(FlexiTableRendererType.custom);
tableEl.setSearchEnabled(true);
tableEl.setCustomizeColumns(true);
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
tableEl.setPageSize(24);
VelocityContainer row = createVelocityContainer("media_row");
// sets its own DOM id in velocity container
row.setDomReplacementWrapperRequired(false);
tableEl.setRowRenderer(row, this);
tableEl.setCssDelegate(new MediaCssDelegate());
tableEl.setAndLoadPersistedPreferences(ureq, "media-list");
initSorters(tableEl);
initFilters(tableEl);
mapperThumbnailUrl = registerCacheableMapper(ureq, "media-thumbnail", new ThumbnailMapper(model));
row.contextPut("mapperThumbnailUrl", mapperThumbnailUrl);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class PoolsMetadataController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel poolInfosColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
poolInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "share.editable", 0, false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
poolInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.name", 1));
poolInfosModel = new PoolInfosDataModel(poolInfosColumnsModel);
poolInfosTable = uifactory.addTableElement(getWindowControl(), "details_pools", poolInfosModel, getTranslator(), formLayout);
poolInfosTable.setCustomizeColumns(false);
poolInfosTable.setEmtpyTableMessageKey("sharing.pools.empty.table");
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class SharesMetadataController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel sharesColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
sharesColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "share.editable", 0, false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
sharesColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.name", 1));
sharesModel = new SharesDataModel(sharesColumnsModel);
sharesTable = uifactory.addTableElement(getWindowControl(), "details_shares", sharesModel, getTranslator(), formLayout);
sharesTable.setCustomizeColumns(false);
sharesTable.setEmtpyTableMessageKey("sharing.shares.empty.table");
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class PoolsAdminController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.id));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.publicPool, new BooleanCellRenderer(new CSSIconFlexiCellRenderer("o_icon_pool_public"), new CSSIconFlexiCellRenderer("o_icon_pool_private"))));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", translate("edit"), "edit-pool"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.owners", translate("pool.owners"), "owners-pool"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete-pool"));
model = new PoolDataModel(columnsModel, getTranslator());
poolTable = uifactory.addTableElement(getWindowControl(), "pools", model, getTranslator(), formLayout);
poolTable.setCustomizeColumns(false);
poolTable.setRendererType(FlexiTableRendererType.classic);
reloadModel();
createPool = uifactory.addFormLink("create.pool", formLayout, Link.BUTTON);
}
Aggregations