Search in sources :

Example 1 with RatingCellRenderer

use of org.olat.core.gui.components.rating.RatingCellRenderer 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 2 with RatingCellRenderer

use of org.olat.core.gui.components.rating.RatingCellRenderer in project openolat by klemens.

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)

Aggregations

DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)2 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)2 RatingCellRenderer (org.olat.core.gui.components.rating.RatingCellRenderer)2