use of org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions in project openolat by klemens.
the class ThreadListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (foCallback.mayOpenNewThread()) {
newThreadButton = uifactory.addFormLink("msg.create", formLayout, Link.BUTTON_SMALL);
newThreadButton.setIconLeftCSS("o_icon o_icon-fw o_forum_status_thread_icon");
newThreadButton.setElementCssClass("o_sel_forum_thread_new");
}
if (foCallback.mayArchiveForum()) {
archiveForumButton = uifactory.addFormLink("archive.forum", formLayout, Link.BUTTON_SMALL);
archiveForumButton.setIconLeftCSS("o_icon o_icon-fw o_icon_archive_tool");
archiveForumButton.setElementCssClass("o_sel_forum_archive");
}
if (securityModule.isUserAllowedAutoComplete(ureq.getUserSession().getRoles()) && foCallback.mayFilterForUser()) {
userListButton = uifactory.addFormLink("filter", formLayout, Link.BUTTON_SMALL);
userListButton.setIconLeftCSS("o_icon o_icon-fw o_icon_user");
userListButton.setElementCssClass("o_sel_forum_filter");
}
if (formLayout instanceof FormLayoutContainer) {
SearchServiceUIFactory searchServiceUIFactory = (SearchServiceUIFactory) CoreSpringFactory.getBean(SearchServiceUIFactory.class);
searchController = searchServiceUIFactory.createInputController(ureq, getWindowControl(), DisplayOption.STANDARD, mainForm);
if (guestOnly && !searchModule.isGuestEnabled()) {
searchController.setResourceContextEnable(false);
}
listenTo(searchController);
((FormLayoutContainer) formLayout).add("search_input", searchController.getFormItem());
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.type, new StatusTypeCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.thread, "select", new StaticFlexiCellRenderer("select", 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));
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);
}
use of org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions in project openolat by klemens.
the class MembersTableController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
SortKey defaultSortKey = initColumns(columnsModel);
membersModel = new MemberListTableModel(columnsModel, imModule.isOnlineStatusEnabled());
membersModel.setObjects(membersList);
membersTable = uifactory.addTableElement(getWindowControl(), "table", membersModel, pageSize, false, getTranslator(), formLayout);
membersTable.setEmtpyTableMessageKey("nomembers");
membersTable.setAndLoadPersistedPreferences(ureq, this.getClass().getSimpleName());
membersTable.setExportEnabled(false);
membersTable.setElementCssClass("o_sel_member_list");
if (defaultSortKey != null) {
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setDefaultOrderBy(defaultSortKey);
membersTable.setSortSettings(options);
}
}
use of org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions in project OpenOLAT by OpenOLAT.
the class VideoListingController method initSorters.
private void initSorters(FlexiTableElement tableElement) {
List<FlexiTableSort> sorters = new ArrayList<>(8);
sorters.add(new FlexiTableSort(translate("orderby.automatic"), OrderBy.automatic.name()));
sorters.add(new FlexiTableSort(translate("orderby.title"), OrderBy.title.name()));
sorters.add(new FlexiTableSort(translate("orderby.author"), OrderBy.author.name()));
sorters.add(new FlexiTableSort(translate("orderby.creationDate"), OrderBy.creationDate.name()));
sorters.add(new FlexiTableSort(translate("orderby.launchCounter"), OrderBy.launchCounter.name()));
if (repositoryModule.isRatingEnabled()) {
sorters.add(new FlexiTableSort(translate("orderby.rating"), OrderBy.rating.name()));
}
FlexiTableSortOptions options = new FlexiTableSortOptions(sorters);
options.setDefaultOrderBy(new SortKey(OrderBy.creationDate.name(), false));
tableElement.setSortSettings(options);
}
use of org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions in project OpenOLAT by OpenOLAT.
the class ThreadListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (foCallback.mayOpenNewThread()) {
newThreadButton = uifactory.addFormLink("msg.create", formLayout, Link.BUTTON_SMALL);
newThreadButton.setIconLeftCSS("o_icon o_icon-fw o_forum_status_thread_icon");
newThreadButton.setElementCssClass("o_sel_forum_thread_new");
}
if (foCallback.mayArchiveForum()) {
archiveForumButton = uifactory.addFormLink("archive.forum", formLayout, Link.BUTTON_SMALL);
archiveForumButton.setIconLeftCSS("o_icon o_icon-fw o_icon_archive_tool");
archiveForumButton.setElementCssClass("o_sel_forum_archive");
}
if (securityModule.isUserAllowedAutoComplete(ureq.getUserSession().getRoles()) && foCallback.mayFilterForUser()) {
userListButton = uifactory.addFormLink("filter", formLayout, Link.BUTTON_SMALL);
userListButton.setIconLeftCSS("o_icon o_icon-fw o_icon_user");
userListButton.setElementCssClass("o_sel_forum_filter");
}
if (formLayout instanceof FormLayoutContainer) {
SearchServiceUIFactory searchServiceUIFactory = (SearchServiceUIFactory) CoreSpringFactory.getBean(SearchServiceUIFactory.class);
searchController = searchServiceUIFactory.createInputController(ureq, getWindowControl(), DisplayOption.STANDARD, mainForm);
if (guestOnly && !searchModule.isGuestEnabled()) {
searchController.setResourceContextEnable(false);
}
listenTo(searchController);
((FormLayoutContainer) formLayout).add("search_input", searchController.getFormItem());
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.type, new StatusTypeCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ThreadListCols.thread, "select", new StaticFlexiCellRenderer("select", 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));
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);
}
use of org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions in project OpenOLAT by OpenOLAT.
the class MediaCenterController method initSorters.
private void initSorters(FlexiTableElement tableElement) {
List<FlexiTableSort> sorters = new ArrayList<>(14);
sorters.add(new FlexiTableSort(translate(MediaCols.key.i18nHeaderKey()), MediaCols.key.name()));
sorters.add(new FlexiTableSort(translate(MediaCols.type.i18nHeaderKey()), MediaCols.type.name()));
sorters.add(new FlexiTableSort(translate(MediaCols.title.i18nHeaderKey()), MediaCols.title.name()));
sorters.add(new FlexiTableSort(translate(MediaCols.collectionDate.i18nHeaderKey()), MediaCols.collectionDate.name()));
sorters.add(FlexiTableSort.SPACER);
FlexiTableSortOptions options = new FlexiTableSortOptions(sorters);
options.setDefaultOrderBy(new SortKey(OrderBy.title.name(), true));
tableElement.setSortSettings(options);
}
Aggregations