Search in sources :

Example 21 with BooleanCellRenderer

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

the class CheckListBoxListEditController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("config.checkbox.title");
    setFormDescription("config.checkbox.description");
    setFormContextHelp("Assessment#_checklist_cb");
    if (inUse) {
        setFormWarning("config.warning.inuse");
    }
    FormLayoutContainer tableCont = FormLayoutContainer.createCustomFormLayout("tablecontainer", getTranslator(), velocity_root + "/checkboxlist_edit.html");
    formLayout.add(tableCont);
    addLink = uifactory.addFormLink("add.checkbox", tableCont, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.title.i18nKey(), Cols.title.ordinal()));
    Boolean hasScore = (Boolean) config.get(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD);
    boolean visible = (hasScore == null || hasScore.booleanValue());
    pointColModel = new DefaultFlexiColumnModel(visible, Cols.points.i18nKey(), Cols.points.ordinal(), false, null);
    columnsModel.addFlexiColumnModel(pointColModel);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.release.i18nKey(), Cols.release.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.file.i18nKey(), Cols.file.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", translate("edit"), "edit"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("up", Cols.up.ordinal(), "up", new BooleanCellRenderer(new StaticFlexiCellRenderer("", "up", "o_icon o_icon-lg o_icon_move_up", translate("up")), null)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("down", Cols.down.ordinal(), "down", new BooleanCellRenderer(new StaticFlexiCellRenderer("", "down", "o_icon o_icon-lg o_icon_move_down", translate("down")), null)));
    model = new CheckboxConfigDataModel(getTranslator(), columnsModel);
    boxTable = uifactory.addTableElement(getWindowControl(), "checkbox-list", model, getTranslator(), tableCont);
    boxTable.setCustomizeColumns(false);
    updateModel();
}
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) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) 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 22 with BooleanCellRenderer

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

the class OverviewQuestionController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.hasError.i18nHeaderKey(), Cols.hasError.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer("o_icon_failed"), new CSSIconFlexiCellRenderer("o_icon_accept"))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.type));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.title));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.points));
    ItemsTableDataModel model = new ItemsTableDataModel(importedItems.getItems(), columnsModel);
    uifactory.addTableElement(getWindowControl(), "overviewTable", model, 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 23 with BooleanCellRenderer

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

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 24 with BooleanCellRenderer

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

the class SharesMetadataController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel sharesColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    sharesColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "share.editable", 0, false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
    sharesColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("pool.name", 1));
    sharesModel = new SharesDataModel(sharesColumnsModel);
    sharesTable = uifactory.addTableElement(getWindowControl(), "details_shares", sharesModel, getTranslator(), formLayout);
    sharesTable.setCustomizeColumns(false);
    sharesTable.setEmtpyTableMessageKey("sharing.shares.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 25 with BooleanCellRenderer

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

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)

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