use of org.olat.modules.fo.ui.ThreadListDataModel 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.modules.fo.ui.ThreadListDataModel in project openolat by klemens.
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");
}
Aggregations