use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class HibernateEntitiesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.entity.i18nKey(), EntityCols.entity.ordinal(), true, EntityCols.entity.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.load.i18nKey(), EntityCols.load.ordinal(), true, EntityCols.load.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.fetch.i18nKey(), EntityCols.fetch.ordinal(), true, EntityCols.fetch.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.insert.i18nKey(), EntityCols.insert.ordinal(), true, EntityCols.insert.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.update.i18nKey(), EntityCols.update.ordinal(), true, EntityCols.update.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.delete.i18nKey(), EntityCols.delete.ordinal(), true, EntityCols.delete.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(EntityCols.optimisticFailure.i18nKey(), EntityCols.optimisticFailure.ordinal(), true, EntityCols.optimisticFailure.name()));
tableModel = new EntityStatisticsDataModel(columnsModel);
table = uifactory.addTableElement(getWindowControl(), "entities", tableModel, 50, true, getTranslator(), formLayout);
table.setAndLoadPersistedPreferences(ureq, "HibernateEntityStatistics");
table.setExportEnabled(true);
table.setPageSize(250);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project openolat by klemens.
the class LandingPagesAdminController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("landingpages.title");
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.position.i18nKey(), RCols.position.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.role.i18nKey(), RCols.role.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.userAttributeKey.i18nKey(), RCols.userAttributeKey.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.userAttributeValue.i18nKey(), RCols.userAttributeValue.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.landingPage.i18nKey(), RCols.landingPage.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.landingPageChooser.i18nKey(), RCols.landingPageChooser.ordinal()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("up", -1, "up", new StaticFlexiCellRenderer("", "up", "o_icon o_icon-lg o_icon_move_up", translate("up"))));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("down", -1, "down", new StaticFlexiCellRenderer("", "down", "o_icon o_icon-lg o_icon_move_down", translate("down"))));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("add", translate("add"), "add"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete"));
// pack the rules
Rules rules = lpModule.getRules();
List<Rule> ruleList = new ArrayList<>(rules.getRules());
if (ruleList.isEmpty()) {
ruleList.add(new Rule());
}
List<RuleWrapper> wrappers = new ArrayList<>();
int i = 0;
for (Rule rule : ruleList) {
wrappers.add(initRuleWrapper(++i, rule, formLayout));
}
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("rules", wrappers);
}
model = new RulesDataModel(columnsModel, wrappers);
tableEl = uifactory.addTableElement(getWindowControl(), "rules", model, getTranslator(), formLayout);
tableEl.setCustomizeColumns(false);
tableEl.setRendererType(FlexiTableRendererType.classic);
FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add("buttons", buttonLayout);
saveButton = uifactory.addFormSubmitButton("save", buttonLayout);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel 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.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method initLicenseTypesTable.
private void initLicenseTypesTable() {
addLicenseTypeButton = uifactory.addFormLink("add.license.type", flc, Link.BUTTON);
addLicenseTypeButton.setIconLeftCSS("o_icon o_icon_lic_add");
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.up, CMD_UP, new BooleanCellRenderer(new StaticFlexiCellRenderer("", CMD_UP, "o_icon o_icon-lg o_icon_move_up"), null)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.down, CMD_DOWN, new BooleanCellRenderer(new StaticFlexiCellRenderer("", CMD_DOWN, "o_icon o_icon-lg o_icon_move_down"), null)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.name));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.nameTranslation, CMD_TRANSLATE, new StaticFlexiCellRenderer(CMD_TRANSLATE, new TextFlexiCellRenderer())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.text));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.cssClass));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LicenseTypeCols.edit, CMD_EDIT, new BooleanCellRenderer(null, new StaticFlexiCellRenderer("", CMD_EDIT, "o_icon o_icon-lg o_icon_edit"))));
// add a checkbox for every enabled license handler
int index = LicenseTypeCols.values().length;
for (LicenseHandler handler : licenseHandlers) {
boolean handlerEnabled = licenseModule.isEnabled(handler);
if (handlerEnabled) {
DefaultFlexiColumnModel columnModel = new DefaultFlexiColumnModel(handler.getType(), index++);
columnModel.setHeaderLabel(handler.getTitle(getLocale()));
columnsModel.addFlexiColumnModel(columnModel);
}
}
dataModel = new LicenseTypeDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "license.types", dataModel, getTranslator(), flc);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel in project OpenOLAT by OpenOLAT.
the class MessagesStatisticsController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
DefaultFlexiColumnModel yearColumn = new DefaultFlexiColumnModel(MLogStatsCols.year, new YearCellRenderer());
yearColumn.setExportable(false);
columnsModel.addFlexiColumnModel(yearColumn);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MLogStatsCols.month, new MonthCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MLogStatsCols.numOfMessages));
model = new MessageStatisticsDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "stats", model, 50, false, getTranslator(), formLayout);
tableEl.setCustomizeColumns(false);
tableEl.setExportEnabled(true);
}
Aggregations