Search in sources :

Example 56 with DefaultFlexiColumnModel

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

the class BusinessGroupListController method initColumnModel.

@Override
protected FlexiTableColumnModel initColumnModel() {
    FlexiTableColumnModel columnsModel = super.initColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.allowDelete.i18n(), Cols.allowDelete.ordinal(), TABLE_ACTION_DELETE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.delete"), TABLE_ACTION_DELETE), null)));
    return columnsModel;
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) 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 57 with DefaultFlexiColumnModel

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

the class ExportOverviewController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "exportable", Cols.exportable.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer("o_icon_accept"), new CSSIconFlexiCellRenderer("o_icon_failed"))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("general.title", Cols.title.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("technical.format", Cols.format.ordinal()));
    itemsModel = new QItemDataModel(columnsModel, format);
    uifactory.addTableElement(getWindowControl(), "shares", itemsModel, getTranslator(), formLayout);
}
Also used : CSSIconFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) 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 58 with DefaultFlexiColumnModel

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

the class ImportAuthorOverviewIdentitiesController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    int colIndex = 0;
    if (isAdministrativeUser) {
        tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.user.login", colIndex++));
    }
    List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
    List<UserPropertyHandler> resultingPropertyHandlers = new ArrayList<UserPropertyHandler>();
    // followed by the users fields
    for (int i = 0; i < userPropertyHandlers.size(); i++) {
        UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
        boolean visible = UserManager.getInstance().isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
        if (visible) {
            resultingPropertyHandlers.add(userPropertyHandler);
            tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex++));
        }
    }
    Translator myTrans = userManager.getPropertyHandlerTranslator(getTranslator());
    ImportAuthorOverviewDataModel userTableModel = new ImportAuthorOverviewDataModel(oks, resultingPropertyHandlers, isAdministrativeUser, getLocale(), tableColumnModel);
    uifactory.addTableElement(getWindowControl(), "users", userTableModel, myTrans, formLayout);
}
Also used : Translator(org.olat.core.gui.translator.Translator) ArrayList(java.util.ArrayList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 59 with DefaultFlexiColumnModel

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

the class RatingMetadataController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel ratingInfosColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    ratingInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("rating.creation.date", 0));
    ratingInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("rating", 1, new RatingCellRenderer(5)));
    ratingInfosModel = new RatingInfosDataModel(ratingInfosColumnsModel);
    ratingInfosTable = uifactory.addTableElement(getWindowControl(), "details_ratings", ratingInfosModel, getTranslator(), formLayout);
    ratingInfosTable.setCustomizeColumns(false);
    ratingInfosTable.setEmtpyTableMessageKey("rating.empty.table");
}
Also used : RatingCellRenderer(org.olat.core.gui.components.rating.RatingCellRenderer) 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 60 with DefaultFlexiColumnModel

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

the class LifecycleAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LCCols.softkey.i18nKey(), LCCols.softkey.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LCCols.label.i18nKey(), LCCols.label.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LCCols.validFrom.i18nKey(), LCCols.validFrom.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(LCCols.validTo.i18nKey(), LCCols.validTo.ordinal()));
    FlexiCellRenderer delRenderer = new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("delete"), "delete-cycle"), null);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", LCCols.delete.ordinal(), "delete-cycle", delRenderer));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", translate(LCCols.edit.i18nKey()), "edit-lifecycle"));
    model = new LifecycleDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "cycles", model, getTranslator(), formLayout);
    tableEl.setRendererType(FlexiTableRendererType.classic);
    tableEl.setCustomizeColumns(false);
    createLifeCycle = uifactory.addFormLink("create.lifecycle", formLayout, Link.BUTTON);
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) FlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) 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