use of org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class SelectForumStepForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.forum));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.select, "forum.select", new StaticFlexiCellRenderer(translate("forum.select"), "forum.select", "", "o_icon o_icon_select o_icon-fw")));
tableModel = new NodeTableDataModel(courseNodes);
tableModel.setTableColumnModel(tableColumnModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, getTranslator(), formLayout);
tableEl.setCustomizeColumns(false);
tableEl.setNumOfRowsEnabled(false);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class ForumMessageListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
List<FlexiTableSort> sorts = new ArrayList<>();
sorts.add(new FlexiTableSort(translate("natural.sort"), "natural"));
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (withType) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ForumMessageCols.type, new StatusTypeCellRenderer()));
sorts.add(new FlexiTableSort(translate(ForumMessageCols.type.i18nHeaderKey()), ForumMessageCols.type.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ForumMessageCols.thread, "select", new StaticFlexiCellRenderer("select", new IndentCellRenderer())));
sorts.add(new FlexiTableSort(translate(ForumMessageCols.thread.i18nHeaderKey()), ForumMessageCols.thread.name()));
int colPos = USER_PROPS_OFFSET;
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
String propName = userPropertyHandler.getName();
boolean visible = userManager.isMandatoryUserProperty(USER_PROPS_ID, userPropertyHandler);
FlexiColumnModel col;
if (UserConstants.FIRSTNAME.equals(propName) || UserConstants.LASTNAME.equals(propName)) {
col = new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colPos, "select", true, propName, new StaticFlexiCellRenderer("select", new TextFlexiCellRenderer()));
} else {
col = new DefaultFlexiColumnModel(visible, userPropertyHandler.i18nColumnDescriptorLabelKey(), colPos, true, propName);
}
sorts.add(new FlexiTableSort(translate(userPropertyHandler.i18nColumnDescriptorLabelKey()), propName));
columnsModel.addFlexiColumnModel(col);
colPos++;
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ForumMessageCols.lastModified));
sorts.add(new FlexiTableSort(translate(ForumMessageCols.lastModified.i18nHeaderKey()), ForumMessageCols.lastModified.name()));
dataModel = new ForumMessageDataModel(columnsModel, getTranslator());
tableEl = uifactory.addTableElement(getWindowControl(), "messages", dataModel, getTranslator(), formLayout);
tableEl.setCssDelegate(new MessageCssDelegate());
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setFromColumnModel(false);
sortOptions.setSorts(sorts);
tableEl.setSortSettings(sortOptions);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer 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.StaticFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class SelectThreadStepForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.type, new StatusTypeCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.thread, "choose", new StaticFlexiCellRenderer("choose", new StickyCellRenderer())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.creator));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.lastModified));
if (!guestOnly) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.markedMessages, "marked", new StaticFlexiCellRenderer("marked", new TextFlexiCellRenderer())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.unreadMessages, "unread", new StaticFlexiCellRenderer("unread", new TextFlexiCellRenderer())));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.totalMessages));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.select, "select", new StaticFlexiCellRenderer(translate("select"), "select", "", "o_icon o_icon_select o_icon-fw")));
threadTableModel = new ThreadListDataModel(columnsModel, getTranslator());
threadTable = uifactory.addTableElement(getWindowControl(), "threads", threadTableModel, getTranslator(), formLayout);
threadTable.setCustomizeColumns(false);
threadTable.setElementCssClass("o_forum");
threadTable.setEmtpyTableMessageKey("forum.emtpy");
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(ThreadListCols.lastModified.name(), false));
threadTable.setSortSettings(sortOptions);
loadModel();
newThreadButton = uifactory.addFormLink("link.new.thread", formLayout, Link.BUTTON);
newThreadButton.setIconLeftCSS("o_icon o_icon-fw o_forum_status_thread_icon");
newThreadButton.setElementCssClass("o_sel_forum_thread_new");
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer 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();
}
Aggregations