use of org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method getCatalogFlexiTableColumnModel.
private FlexiTableColumnModel getCatalogFlexiTableColumnModel(String cmdPrefix) {
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.type.i18nKey(), Cols.type.ordinal(), true, OrderBy.type.name(), FlexiColumnModel.ALIGNMENT_LEFT, new TypeRenderer()));
FlexiCellRenderer renderer = new StaticFlexiCellRenderer(cmdPrefix + "select", new TextFlexiCellRenderer());
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.displayName.i18nKey(), Cols.displayName.ordinal(), cmdPrefix + "select", true, OrderBy.displayname.name(), renderer));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.authors.i18nKey(), Cols.authors.ordinal(), true, OrderBy.authors.name()));
if (repositoryModule.isManagedRepositoryEntries()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalId.i18nKey(), Cols.externalId.ordinal(), true, OrderBy.externalId.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalRef.i18nKey(), Cols.externalRef.ordinal(), true, OrderBy.externalRef.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lifecycleLabel.i18nKey(), Cols.lifecycleLabel.ordinal(), true, OrderBy.lifecycleLabel.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lifecycleSoftkey.i18nKey(), Cols.lifecycleSoftkey.ordinal(), true, OrderBy.lifecycleSoftkey.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleStart.i18nKey(), Cols.lifecycleStart.ordinal(), true, OrderBy.lifecycleStart.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleEnd.i18nKey(), Cols.lifecycleEnd.ordinal(), true, OrderBy.lifecycleEnd.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.access.i18nKey(), Cols.access.ordinal(), true, OrderBy.access.name(), FlexiColumnModel.ALIGNMENT_LEFT, new AccessRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.ac.i18nKey(), Cols.ac.ordinal(), true, OrderBy.ac.name(), FlexiColumnModel.ALIGNMENT_LEFT, new ACRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.creationDate.i18nKey(), Cols.creationDate.ordinal(), true, OrderBy.creationDate.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.delete.i18nKey(), translate(Cols.delete.i18nKey()), cmdPrefix + "delete"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.move.i18nKey(), translate(Cols.move.i18nKey()), cmdPrefix + "move"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.detailsSupported.i18nKey(), Cols.detailsSupported.ordinal(), cmdPrefix + "details", new StaticFlexiCellRenderer("", cmdPrefix + "details", "o_icon o_icon-lg o_icon_details", translate("details"))));
return columnsModel;
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class OpenBusinessGroupListController method initColumnModel.
@Override
protected FlexiTableColumnModel initColumnModel() {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name.i18n(), Cols.name.ordinal(), TABLE_ACTION_LAUNCH, true, Cols.name.name(), new StaticFlexiCellRenderer(TABLE_ACTION_LAUNCH, new BusinessGroupNameCellRenderer())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18n(), Cols.key.ordinal(), true, Cols.key.name()));
if (groupModule.isManagedBusinessGroups()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalId.i18n(), Cols.externalId.ordinal(), true, Cols.externalId.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.description.i18n(), Cols.description.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new TextFlexiCellRenderer(EscapeMode.antisamy)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.resources.i18n(), Cols.resources.ordinal(), true, Cols.resources.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGResourcesCellRenderer(flc)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.freePlaces.i18n(), Cols.freePlaces.ordinal(), TABLE_ACTION_LAUNCH, true, Cols.freePlaces.name(), new TextFlexiCellRenderer(EscapeMode.none)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), true, Cols.accessTypes.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGAccessControlledCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.role.i18n(), Cols.role.ordinal(), true, Cols.role.name(), FlexiColumnModel.ALIGNMENT_LEFT, new BGRoleCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.accessControlLaunch.i18n(), Cols.accessControlLaunch.ordinal()));
return columnsModel;
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class ForumUserListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
backLink = uifactory.addFormLink("back", formLayout, Link.LINK_BACK);
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
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);
}
columnsModel.addFlexiColumnModel(col);
colPos++;
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(UserCols.threads));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(UserCols.replies));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(UserCols.lastModified));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(UserCols.numOfWords));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(UserCols.numOfCharacters));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("viewswitch.title", translate("viewswitch.title"), "select"));
dataModel = new ForumUserDataModel(columnsModel, getTranslator());
tableEl = uifactory.addTableElement(getWindowControl(), "users", dataModel, getTranslator(), formLayout);
tableEl.setPageSize(50);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer 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.impl.elements.table.TextFlexiCellRenderer in project OpenOLAT by OpenOLAT.
the class GroupSearchController method initForm.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
* org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
*/
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormDescription("group.search.description");
formLayout.setElementCssClass("o_sel_groups_search");
search = uifactory.addTextElement("search.field", "search.field", 100, "", formLayout);
if (isUsedInStepWizzard()) {
searchLink = uifactory.addFormLink("search", formLayout, Link.BUTTON);
} else {
searchButton = uifactory.addFormSubmitButton("search", formLayout);
uifactory.addSpacerElement("space", formLayout, false);
}
errorComp = uifactory.createSimpleErrorText("error", "");
formLayout.add(errorComp);
tableCont = FormLayoutContainer.createCustomFormLayout("", getTranslator(), velocity_root + "/resulttable.html");
tableCont.setRootForm(mainForm);
formLayout.add(tableCont);
// group rights
FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.groupName.i18n(), Cols.groupName.ordinal()));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.description.i18n(), Cols.description.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new TextFlexiCellRenderer(EscapeMode.antisamy)));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.courses.i18n(), Cols.courses.ordinal()));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.tutor.i18n(), Cols.tutor.ordinal()));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.participant.i18n(), Cols.participant.ordinal()));
tableDataModel = new GroupTableDataModel(Collections.<GroupWrapper>emptyList(), tableColumnModel);
table = uifactory.addTableElement(getWindowControl(), "groupList", tableDataModel, getTranslator(), tableCont);
table.setCustomizeColumns(false);
tableCont.add("groupList", table);
if (!isUsedInStepWizzard()) {
saveLink = uifactory.addFormLink("save", formLayout, Link.BUTTON);
}
}
Aggregations