Search in sources :

Example 1 with CSSIconFlexiCellRenderer

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

the class AbstractItemListController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("quickview", "<i class='o_icon o_icon_quickview'> </i>", "quick-view"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.mark.i18nKey(), Cols.mark.ordinal(), true, OrderBy.marks.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.editable.i18nKey(), Cols.editable.ordinal(), false, null, FlexiColumnModel.ALIGNMENT_LEFT, new BooleanCellRenderer(new CSSIconFlexiCellRenderer(CSS_ICON_READWRITE), new CSSIconFlexiCellRenderer(CSS_ICON_READONLY))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.identifier.i18nKey(), Cols.identifier.ordinal(), true, OrderBy.identifier.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.title.i18nKey(), Cols.title.ordinal(), true, OrderBy.title.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.topic.i18nKey(), Cols.topic.ordinal(), true, OrderBy.topic.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.creationDate.i18nKey(), Cols.creationDate.ordinal(), true, OrderBy.creationDate.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lastModified.i18nKey(), Cols.lastModified.ordinal(), true, OrderBy.lastModified.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.keywords.i18nKey(), Cols.keywords.ordinal(), true, OrderBy.keywords.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.coverage.i18nKey(), Cols.coverage.ordinal(), true, OrderBy.coverage.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.additionalInfos.i18nKey(), Cols.additionalInfos.ordinal(), true, OrderBy.additionalInformations.name()));
    if (getSecurityCallback().canUseTaxonomy()) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxnonomyLevel.i18nKey(), Cols.taxnonomyLevel.ordinal(), true, OrderBy.taxonomyLevel.name()));
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.taxnonomyPath.i18nKey(), Cols.taxnonomyPath.ordinal(), true, OrderBy.taxonomyPath.name()));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.difficulty.i18nKey(), Cols.difficulty.ordinal(), true, OrderBy.difficulty.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.stdevDifficulty.i18nKey(), Cols.stdevDifficulty.ordinal(), true, OrderBy.stdevDifficulty.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.differentiation.i18nKey(), Cols.differentiation.ordinal(), true, OrderBy.differentiation.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.numOfAnswerAlternatives.i18nKey(), Cols.numOfAnswerAlternatives.ordinal(), true, OrderBy.numOfAnswerAlternatives.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.usage.i18nKey(), Cols.usage.ordinal(), true, OrderBy.usage.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.type.i18nKey(), Cols.type.ordinal(), true, OrderBy.itemType.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.format.i18nKey(), Cols.format.ordinal(), true, OrderBy.format.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.rating.i18nKey(), Cols.rating.ordinal(), true, OrderBy.rating.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.numberOfRatings.i18nKey(), Cols.numberOfRatings.ordinal(), true, OrderBy.numberOfRatings.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.itemVersion.i18nKey(), Cols.itemVersion.ordinal(), true, OrderBy.itemVersion.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.status.i18nKey(), Cols.status.ordinal(), true, OrderBy.status.name(), new QuestionStatusCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.statusLastModified.i18nKey(), Cols.statusLastModified.ordinal(), true, OrderBy.statusLastModified.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()))));
    }
    initActionColumns(columnsModel);
    model = new QuestionItemDataModel(columnsModel, this, getTranslator());
    itemsTable = uifactory.addTableElement(getWindowControl(), "items", model, 50, false, getTranslator(), formLayout);
    itemsTable.setWrapperSelector("qitems");
    itemsTable.setSelectAllEnable(true);
    itemsTable.setMultiSelect(true);
    itemsTable.setSearchEnabled(true);
    itemsTable.setSortSettings(new FlexiTableSortOptions(true));
    itemsTable.setExtendedSearch(extendedSearchCtrl);
    itemsTable.setColumnIndexForDragAndDropLabel(Cols.title.ordinal());
    itemsTable.setAndLoadPersistedPreferences(ureq, "qpool-list-" + prefsKey);
    listenTo(extendedSearchCtrl);
    VelocityContainer detailsVC = createVelocityContainer("item_list_details");
    itemsTable.setDetailsRenderer(detailsVC, this);
    FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
    sortOptions.setDefaultOrderBy(new SortKey(OrderBy.title.name(), true));
    itemsTable.setSortSettings(sortOptions);
    initButtons(ureq, formLayout);
    itemsTable.reloadData();
}
Also used : FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) 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) SortKey(org.olat.core.commons.persistence.SortKey) QuestionStatusCellRenderer(org.olat.core.gui.components.table.QuestionStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) LicenseRenderer(org.olat.core.commons.services.license.ui.LicenseRenderer) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 2 with CSSIconFlexiCellRenderer

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

the class CreateTestOverviewController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, "export.overview.accept", Cols.accept.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);
    FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add("buttons", buttonLayout);
    uifactory.addFormSubmitButton("create.test", buttonLayout);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
}
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) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 3 with CSSIconFlexiCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer 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 4 with CSSIconFlexiCellRenderer

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

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 5 with CSSIconFlexiCellRenderer

use of org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer 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)

Aggregations

BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)18 CSSIconFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer)18 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)18 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)18 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)4 SortKey (org.olat.core.commons.persistence.SortKey)2 LicenseRenderer (org.olat.core.commons.services.license.ui.LicenseRenderer)2 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)2 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)2 QuestionStatusCellRenderer (org.olat.core.gui.components.table.QuestionStatusCellRenderer)2 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)2