Search in sources :

Example 1 with DescriptionWithTooltipCellRenderer

use of org.olat.course.nodes.gta.ui.component.DescriptionWithTooltipCellRenderer in project OpenOLAT by OpenOLAT.

the class GTAAvailableTaskController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.title.i18nKey(), ATDCols.title.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.description.i18nKey(), ATDCols.description.ordinal(), new DescriptionWithTooltipCellRenderer()));
    boolean preview = gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_PREVIEW);
    if (preview) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.preview.i18nKey(), ATDCols.preview.ordinal()));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", -1, "select", new StaticFlexiCellRenderer(translate("select"), "select", "btn btn-primary", "o_icon o_icon_submit")));
    taskModel = new AvailableTaskTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", taskModel, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(false);
    tableEl.setNumOfRowsEnabled(false);
    formLayout.add("table", tableEl);
    loadModel();
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) DescriptionWithTooltipCellRenderer(org.olat.course.nodes.gta.ui.component.DescriptionWithTooltipCellRenderer)

Example 2 with DescriptionWithTooltipCellRenderer

use of org.olat.course.nodes.gta.ui.component.DescriptionWithTooltipCellRenderer in project openolat by klemens.

the class GTAAvailableTaskController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.title.i18nKey(), ATDCols.title.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.description.i18nKey(), ATDCols.description.ordinal(), new DescriptionWithTooltipCellRenderer()));
    boolean preview = gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_PREVIEW);
    if (preview) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ATDCols.preview.i18nKey(), ATDCols.preview.ordinal()));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", -1, "select", new StaticFlexiCellRenderer(translate("select"), "select", "btn btn-primary", "o_icon o_icon_submit")));
    taskModel = new AvailableTaskTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", taskModel, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(false);
    tableEl.setNumOfRowsEnabled(false);
    formLayout.add("table", tableEl);
    loadModel();
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) DescriptionWithTooltipCellRenderer(org.olat.course.nodes.gta.ui.component.DescriptionWithTooltipCellRenderer)

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 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)2 DescriptionWithTooltipCellRenderer (org.olat.course.nodes.gta.ui.component.DescriptionWithTooltipCellRenderer)2