Search in sources :

Example 1 with SectionStatusCellRenderer

use of org.olat.modules.portfolio.ui.component.SectionStatusCellRenderer in project OpenOLAT by OpenOLAT.

the class BinderAssessmentController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.sectionName));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.numOfPages));
    if (withPassed) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.passed, new PassedCellRenderer()));
    }
    if (withScore) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.score, new ScoreCellRenderer()));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.changeStatus, new SectionStatusCellRenderer(getTranslator())));
    model = new BinderAssessmentDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "section-list", model, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(true);
    tableEl.setEditMode(true);
    tableEl.setAndLoadPersistedPreferences(ureq, "section-assessment");
    FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonsCont);
    saveButton = uifactory.addFormSubmitButton("save", buttonsCont);
    saveButton.setElementCssClass("o_sel_pf_assessment_save");
    saveAndDoneLink = uifactory.addFormLink("save.done", buttonsCont, Link.BUTTON);
    saveAndDoneLink.setElementCssClass("o_sel_pf_assessment_save_done");
    reopenLink = uifactory.addFormLink("reopen.binder", buttonsCont, Link.BUTTON);
    reopenLink.setElementCssClass("o_sel_pf_assessment_reopen");
    cancelButton = uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
}
Also used : ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) SectionStatusCellRenderer(org.olat.modules.portfolio.ui.component.SectionStatusCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) PassedCellRenderer(org.olat.modules.portfolio.ui.renderer.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 2 with SectionStatusCellRenderer

use of org.olat.modules.portfolio.ui.component.SectionStatusCellRenderer in project openolat by klemens.

the class BinderAssessmentController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.sectionName));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.numOfPages));
    if (withPassed) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.passed, new PassedCellRenderer()));
    }
    if (withScore) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.score, new ScoreCellRenderer()));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.changeStatus, new SectionStatusCellRenderer(getTranslator())));
    model = new BinderAssessmentDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "section-list", model, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(true);
    tableEl.setEditMode(true);
    tableEl.setAndLoadPersistedPreferences(ureq, "section-assessment");
    FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonsCont);
    saveButton = uifactory.addFormSubmitButton("save", buttonsCont);
    saveButton.setElementCssClass("o_sel_pf_assessment_save");
    saveAndDoneLink = uifactory.addFormLink("save.done", buttonsCont, Link.BUTTON);
    saveAndDoneLink.setElementCssClass("o_sel_pf_assessment_save_done");
    reopenLink = uifactory.addFormLink("reopen.binder", buttonsCont, Link.BUTTON);
    reopenLink.setElementCssClass("o_sel_pf_assessment_reopen");
    cancelButton = uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
}
Also used : ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) SectionStatusCellRenderer(org.olat.modules.portfolio.ui.component.SectionStatusCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) PassedCellRenderer(org.olat.modules.portfolio.ui.renderer.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 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 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)2 SectionStatusCellRenderer (org.olat.modules.portfolio.ui.component.SectionStatusCellRenderer)2 PassedCellRenderer (org.olat.modules.portfolio.ui.renderer.PassedCellRenderer)2