Search in sources :

Example 96 with DefaultFlexiColumnModel

use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project openolat by klemens.

the class TaxonomyTreeTableController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    newLevelButton = uifactory.addFormLink("add.taxonomy.level", formLayout, Link.BUTTON);
    deleteButton = uifactory.addFormLink("delete", formLayout, Link.BUTTON);
    mergeButton = uifactory.addFormLink("merge.taxonomy.level", formLayout, Link.BUTTON);
    typeButton = uifactory.addFormLink("type.taxonomy.level", formLayout, Link.BUTTON);
    moveButton = uifactory.addFormLink("move.taxonomy.level", formLayout, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, TaxonomyLevelCols.key));
    TreeNodeFlexiCellRenderer treeNodeRenderer = new TreeNodeFlexiCellRenderer();
    treeNodeRenderer.setFlatBySearchAndFilter(true);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.displayName, treeNodeRenderer));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.identifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.typeIdentifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.numOfChildren));
    DefaultFlexiColumnModel selectColumn = new DefaultFlexiColumnModel("select", translate("select"), "select");
    selectColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(selectColumn);
    DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(TaxonomyLevelCols.tools);
    toolsColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(toolsColumn);
    model = new TaxonomyTreeTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setSearchEnabled(true);
    tableEl.setCustomizeColumns(true);
    tableEl.setElementCssClass("o_taxonomy_level_listing");
    tableEl.setEmtpyTableMessageKey("table.taxonomy.level.empty");
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setExportEnabled(true);
    tableEl.setPageSize(24);
    tableEl.setMultiSelect(true);
    tableEl.setFilters(null, getFilters(), true);
    tableEl.setRootCrumb(new TaxonomyCrumb(taxonomy.getDisplayName()));
}
Also used : TreeNodeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TreeNodeFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 97 with DefaultFlexiColumnModel

use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project openolat by klemens.

the class VideoQualityTableFormController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(QualityTableCols.resolution));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(QualityTableCols.dimension));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(QualityTableCols.size, new TranscodingErrorIconRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(QualityTableCols.format));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(QualityTableCols.delete));
    tableModel = new VideoQualityTableModel(columnsModel, getTranslator());
    initTable();
}
Also used : FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 98 with DefaultFlexiColumnModel

use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project openolat by klemens.

the class AuthorDeletedListController method initActionsColumns.

@Override
protected void initActionsColumns(FlexiTableColumnModel columnsModel) {
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.deletedBy.i18nKey(), Cols.deletedBy.ordinal(), true, OrderBy.deletedBy.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.deletionDate.i18nKey(), Cols.deletionDate.ordinal(), true, OrderBy.deletionDate.name(), new DateFlexiCellRenderer(getLocale())));
    DefaultFlexiColumnModel detailsColumn = new DefaultFlexiColumnModel(Cols.detailsSupported.i18nKey(), Cols.detailsSupported.ordinal(), "details", new StaticFlexiCellRenderer("", "details", "o_icon o_icon-lg o_icon_details", translate("details")));
    detailsColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(detailsColumn);
    if (hasAuthorRight) {
        DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(Cols.tools.i18nKey(), Cols.tools.ordinal());
        toolsColumn.setExportable(false);
        columnsModel.addFlexiColumnModel(toolsColumn);
    }
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 99 with DefaultFlexiColumnModel

use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project openolat by klemens.

the class AuthorListController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // search form
    if (withSearch) {
        setFormDescription("table.search.author.desc");
        searchCtrl = new AuthorSearchController(ureq, getWindowControl(), true, mainForm);
        searchCtrl.setEnabled(false);
        listenTo(searchCtrl);
    }
    if (withClosedfilter) {
        String[] statusValues = new String[] { translate("cif.resources.status.all"), translate("cif.resources.status.active"), translate("cif.resources.status.closed") };
        closedEl = uifactory.addRadiosHorizontal("cif_status", "cif.resources.status", formLayout, statusKeys, statusValues);
        closedEl.addActionListener(FormEvent.ONCHANGE);
        closedEl.setDomReplacementWrapperRequired(false);
        closedEl.select(statusKeys[1], true);
        searchParams.setClosed(Boolean.FALSE);
    }
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
    DefaultFlexiColumnModel markColumn = new DefaultFlexiColumnModel(true, Cols.mark.i18nKey(), Cols.mark.ordinal(), true, OrderBy.favorit.name());
    markColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(markColumn);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.type.i18nKey(), Cols.type.ordinal(), true, OrderBy.type.name(), FlexiColumnModel.ALIGNMENT_LEFT, new TypeRenderer()));
    FlexiCellRenderer renderer = new StaticFlexiCellRenderer("select", new TextFlexiCellRenderer());
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.displayName.i18nKey(), Cols.displayName.ordinal(), "select", true, OrderBy.displayname.name(), renderer));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.authors.i18nKey(), Cols.authors.ordinal(), true, OrderBy.authors.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.location.i18nKey(), Cols.location.ordinal(), true, OrderBy.location.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.author.i18nKey(), Cols.author.ordinal(), true, OrderBy.author.name()));
    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(false, Cols.lastUsage.i18nKey(), Cols.lastUsage.ordinal(), true, OrderBy.lastUsage.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.references.i18nKey(), Cols.references.ordinal(), true, OrderBy.references.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()))));
    }
    initActionsColumns(columnsModel);
    model = new AuthoringEntryDataModel(dataSource, columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setSearchEnabled(withSearch);
    tableEl.setCssDelegate(this);
    tableEl.setExportEnabled(true);
    tableEl.setExtendedSearch(searchCtrl);
    tableEl.setCustomizeColumns(true);
    tableEl.setElementCssClass("o_coursetable");
    tableEl.setShowAllRowsEnabled(true);
    tableEl.setMultiSelect(true);
    tableEl.setSelectAllEnable(true);
    tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
    tableEl.setSortSettings(new FlexiTableSortOptions(true, new SortKey(OrderBy.displayname.name(), true)));
    tableEl.setAndLoadPersistedPreferences(ureq, "authors-list-" + i18nName);
    if (!withSearch) {
        tableEl.reloadData();
        tableEl.setFilters(null, getFilters(), false);
    }
    initBatchButtons(formLayout);
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) FlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer) SortKey(org.olat.core.commons.persistence.SortKey) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) LicenseRenderer(org.olat.core.commons.services.license.ui.LicenseRenderer)

Example 100 with DefaultFlexiColumnModel

use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project openolat by klemens.

the class PaypalTransactionsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    backLink = uifactory.addFormLink("back", formLayout, Link.LINK_BACK);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.status, new PaypalTransactionStatusRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.orderNr));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.payResponseDate));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.payAmount));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnTransactionId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.ipnTransactionStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSenderTransactionId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSenderTransactionStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnPendingReason));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSender));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.payAck));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.payPaymentExecStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.olatStatus));
    DefaultFlexiColumnModel selectColumns = new DefaultFlexiColumnModel("select", translate("select"), CMD_SELECT);
    selectColumns.setExportable(false);
    selectColumns.setAlwaysVisible(true);
    columnsModel.addFlexiColumnModel(selectColumns);
    dataModel = new PaypalTransactionDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "results", dataModel, 25, false, getTranslator(), formLayout);
    tableEl.setEmtpyTableMessageKey("paypal.transactions.empty");
    tableEl.setCustomizeColumns(true);
    tableEl.setExportEnabled(true);
    tableEl.setSearchEnabled(true);
    FlexiTableSortOptions options = new FlexiTableSortOptions();
    options.setDefaultOrderBy(new SortKey(Columns.payResponseDate.name(), false));
    options.setFromColumnModel(true);
    tableEl.setSortSettings(options);
    List<FlexiTableFilter> filters = new ArrayList<>();
    filters.add(new FlexiTableFilter(translate("show.all"), "showAll"));
    filters.add(FlexiTableFilter.SPACER);
    for (PaypalMergedState state : PaypalMergedState.values()) {
        filters.add(new FlexiTableFilter(translate("filter.".concat(state.name())), state.name()));
    }
    tableEl.setFilters("", filters, false);
    ;
    tableEl.setAndLoadPersistedPreferences(ureq, "FPaypalTransaction");
}
Also used : FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) SortKey(org.olat.core.commons.persistence.SortKey) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)272 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)254 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)126 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)74 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)72 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)72 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)64 ArrayList (java.util.ArrayList)44 SortKey (org.olat.core.commons.persistence.SortKey)44 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)40 FlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiColumnModel)36 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)28 FlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer)26 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)22 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)20 CSSIconFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer)18 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)18 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)14 FlexiTableElement (org.olat.core.gui.components.form.flexible.elements.FlexiTableElement)12 Translator (org.olat.core.gui.translator.Translator)12