Search in sources :

Example 51 with BooleanCellRenderer

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

the class PoolsAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.id));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.publicPool, new BooleanCellRenderer(new CSSIconFlexiCellRenderer("o_icon_pool_public"), new CSSIconFlexiCellRenderer("o_icon_pool_private"))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.name));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", translate("edit"), "edit-pool"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.owners", translate("pool.owners"), "owners-pool"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete-pool"));
    model = new PoolDataModel(columnsModel, getTranslator());
    poolTable = uifactory.addTableElement(getWindowControl(), "pools", model, getTranslator(), formLayout);
    poolTable.setCustomizeColumns(false);
    poolTable.setRendererType(FlexiTableRendererType.classic);
    reloadModel();
    createPool = uifactory.addFormLink("create.pool", formLayout, Link.BUTTON);
}
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 52 with BooleanCellRenderer

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

the class QEducationalContextsAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.id.i18nKey(), Cols.id.ordinal(), true, "key"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.level.i18nKey(), Cols.level.ordinal(), true, "level"));
    FlexiCellRenderer renderer = new StaticFlexiCellRenderer("translate", new TextFlexiCellRenderer());
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.levelI18n.i18nKey(), Cols.levelI18n.ordinal(), "translate", renderer));
    FlexiCellRenderer delRenderer = new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("delete"), "delete-level"), null);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", Cols.deletable.ordinal(), "delete-level", delRenderer));
    model = new LevelDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "levels", model, getTranslator(), formLayout);
    tableEl.setRendererType(FlexiTableRendererType.classic);
    tableEl.setCustomizeColumns(false);
    createType = uifactory.addFormLink("create.level", 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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) 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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 53 with BooleanCellRenderer

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

the class QItemTypesAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.id.i18nKey(), Cols.id.ordinal(), true, "key"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.type.i18nKey(), Cols.type.ordinal(), true, "name"));
    FlexiCellRenderer renderer = new StaticFlexiCellRenderer("translate", new TextFlexiCellRenderer());
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.typeI18n.i18nKey(), Cols.typeI18n.ordinal(), "translate", renderer));
    FlexiCellRenderer delRenderer = new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("delete"), "delete-type"), null);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", Cols.deletable.ordinal(), "delete-type", delRenderer));
    model = new QItemTypeDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "types", model, getTranslator(), formLayout);
    tableEl.setRendererType(FlexiTableRendererType.classic);
    tableEl.setCustomizeColumns(false);
    createType = uifactory.addFormLink("create.type", 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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) 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) TextFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 54 with BooleanCellRenderer

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

the class PoolsMetadataController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel poolInfosColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    poolInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "share.editable", 0, false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
    poolInfosColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.name", 1));
    poolInfosModel = new PoolInfosDataModel(poolInfosColumnsModel);
    poolInfosTable = uifactory.addTableElement(getWindowControl(), "details_pools", poolInfosModel, getTranslator(), formLayout);
    poolInfosTable.setCustomizeColumns(false);
    poolInfosTable.setEmtpyTableMessageKey("sharing.pools.empty.table");
}
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 55 with BooleanCellRenderer

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

the class TeacherLecturesTableController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    if (withRepositoryEntry) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.externalRef, "open.course"));
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.entry, "open.course"));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.date, new DateFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.startTime, new TimeFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.endTime, new TimeFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.lectureBlock));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.location));
    if (withTeachers) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.teachers));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.status, new LectureBlockStatusCellRenderer(getTranslator())));
    DefaultFlexiColumnModel detailsCol = new DefaultFlexiColumnModel(TeachCols.details.i18nHeaderKey(), TeachCols.details.ordinal(), "details", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.details"), "details"), null));
    // set sort key even though we do not sort - added as css classes to column headers for styling
    detailsCol.setSortKey(TeachCols.details.name());
    columnsModel.addFlexiColumnModel(detailsCol);
    DefaultFlexiColumnModel toolsCol = new DefaultFlexiColumnModel(TeachCols.tools);
    toolsCol.setSortable(false);
    columnsModel.addFlexiColumnModel(toolsCol);
    tableModel = new TeacherOverviewDataModel(columnsModel, getLocale());
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
    FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
    sortOptions.setDefaultOrderBy(new SortKey(TeachCols.date.name(), sortAsc));
    tableEl.setSortSettings(sortOptions);
    tableEl.setCustomizeColumns(false);
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setEmtpyTableMessageKey(emptyI18nKey);
    tableEl.setAndLoadPersistedPreferences(ureq, "lecture-teacher-overview-".concat(id));
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) TimeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer) 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) SortKey(org.olat.core.commons.persistence.SortKey) LectureBlockStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)72 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)72 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)70 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)56 CSSIconFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer)18 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)14 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)12 SortKey (org.olat.core.commons.persistence.SortKey)10 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)10 FlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer)10 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)8 ArrayList (java.util.ArrayList)6 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)6 IndentedNodeRenderer (org.olat.course.assessment.IndentedNodeRenderer)4 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)4 SharedPageStatusCellRenderer (org.olat.modules.portfolio.ui.renderer.SharedPageStatusCellRenderer)4 StatusCellRenderer (org.olat.modules.portfolio.ui.renderer.StatusCellRenderer)4 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)4 LicenseHandler (org.olat.core.commons.services.license.LicenseHandler)2 LicenseRenderer (org.olat.core.commons.services.license.ui.LicenseRenderer)2