Search in sources :

Example 1 with IndentedNodeRenderer

use of org.olat.course.assessment.IndentedNodeRenderer in project OpenOLAT by OpenOLAT.

the class SelectTestOrSurveyController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.node, new IndentedNodeRenderer()));
    tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.action.select", Cols.select.ordinal(), "select", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.action.select"), "select"), null)));
    tableModel = new NodeTableDataModel(nodes, tableColumnModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "nodeList", tableModel, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(false);
}
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) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 2 with IndentedNodeRenderer

use of org.olat.course.assessment.IndentedNodeRenderer in project openolat by klemens.

the class IdentityAssessmentOverviewController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.node, new IndentedNodeRenderer() {

        @Override
        public boolean isIndentationEnabled() {
            return tableEl.getOrderBy() == null || tableEl.getOrderBy().length == 0;
        }
    }));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.attempts));
    if (!followUserResultsVisibility) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.userVisibility, new UserVisibilityCellRenderer(getTranslator())));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.score, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.min, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.max, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.passed, new PassedCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.numOfAssessmentDocs));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.status, new AssessmentStatusCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.lastUserModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastCoachModified));
    if (nodesSelectable) {
        DefaultFlexiColumnModel selectCol = new DefaultFlexiColumnModel("select", NodeCols.select.ordinal(), CMD_SELECT_NODE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("select"), CMD_SELECT_NODE), null));
        selectCol.setExportable(false);
        columnsModel.addFlexiColumnModel(selectCol);
    }
    tableModel = new IdentityAssessmentOverviewTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 250, false, getTranslator(), formLayout);
    tableEl.setExportEnabled(true);
    tableEl.setEmtpyTableMessageKey("nodesoverview.emptylist");
    tableEl.setBordered(true);
    tableEl.setNumOfRowsEnabled(false);
    if (allowTableFiltering) {
        List<FlexiTableFilter> filters = new ArrayList<>();
        filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
        filters.add(FlexiTableFilter.SPACER);
        filters.add(new FlexiTableFilter(translate("filter.passed"), "passed"));
        filters.add(new FlexiTableFilter(translate("filter.failed"), "failed"));
        filters.add(new FlexiTableFilter(translate("filter.inProgress"), "inProgress"));
        filters.add(new FlexiTableFilter(translate("filter.inReview"), "inReview"));
        filters.add(new FlexiTableFilter(translate("filter.done"), "done"));
        tableEl.setFilters("", filters, false);
    }
}
Also used : ArrayList(java.util.ArrayList) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 3 with IndentedNodeRenderer

use of org.olat.course.assessment.IndentedNodeRenderer in project OpenOLAT by OpenOLAT.

the class IdentityAssessmentOverviewController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.node, new IndentedNodeRenderer() {

        @Override
        public boolean isIndentationEnabled() {
            return tableEl.getOrderBy() == null || tableEl.getOrderBy().length == 0;
        }
    }));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.attempts));
    if (!followUserResultsVisibility) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.userVisibility, new UserVisibilityCellRenderer(getTranslator())));
    }
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.score, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.min, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.max, new ScoreCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.passed, new PassedCellRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.numOfAssessmentDocs));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.status, new AssessmentStatusCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.lastUserModified));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastCoachModified));
    if (nodesSelectable) {
        DefaultFlexiColumnModel selectCol = new DefaultFlexiColumnModel("select", NodeCols.select.ordinal(), CMD_SELECT_NODE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("select"), CMD_SELECT_NODE), null));
        selectCol.setExportable(false);
        columnsModel.addFlexiColumnModel(selectCol);
    }
    tableModel = new IdentityAssessmentOverviewTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 250, false, getTranslator(), formLayout);
    tableEl.setExportEnabled(true);
    tableEl.setEmtpyTableMessageKey("nodesoverview.emptylist");
    tableEl.setBordered(true);
    tableEl.setNumOfRowsEnabled(false);
    if (allowTableFiltering) {
        List<FlexiTableFilter> filters = new ArrayList<>();
        filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
        filters.add(FlexiTableFilter.SPACER);
        filters.add(new FlexiTableFilter(translate("filter.passed"), "passed"));
        filters.add(new FlexiTableFilter(translate("filter.failed"), "failed"));
        filters.add(new FlexiTableFilter(translate("filter.inProgress"), "inProgress"));
        filters.add(new FlexiTableFilter(translate("filter.inReview"), "inReview"));
        filters.add(new FlexiTableFilter(translate("filter.done"), "done"));
        tableEl.setFilters("", filters, false);
    }
}
Also used : ArrayList(java.util.ArrayList) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 4 with IndentedNodeRenderer

use of org.olat.course.assessment.IndentedNodeRenderer in project OpenOLAT by OpenOLAT.

the class GenericArchiveController method doNodeChoose.

/**
 * @param ureq
 */
private void doNodeChoose(UserRequest ureq, VelocityContainer nodeChoose) {
    // table configuraton
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setTableEmptyMessage(translate("nodesoverview.nonodes"));
    tableConfig.setDownloadOffered(false);
    tableConfig.setSortingEnabled(false);
    tableConfig.setDisplayTableHeader(true);
    tableConfig.setDisplayRowCount(false);
    tableConfig.setPageingEnabled(false);
    removeAsListenerAndDispose(nodeListCtr);
    nodeListCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
    listenTo(nodeListCtr);
    // table columns
    nodeListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.node", 0, null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new IndentedNodeRenderer()));
    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1, CMD_SELECT_NODE, getLocale()));
    // get list of course node data and populate table data model
    ICourse course = CourseFactory.loadCourse(ores);
    CourseNode rootNode = course.getRunStructure().getRootNode();
    List<AssessmentNodeData> nodesTableObjectArrayList = addNodesAndParentsToList(0, rootNode);
    // only populate data model if data available
    if (nodesTableObjectArrayList == null) {
        nodeChoose.contextPut("hasNodes", Boolean.FALSE);
    } else {
        nodeChoose.contextPut("hasNodes", Boolean.TRUE);
        nodeTableModel = new NodeTableDataModel(nodesTableObjectArrayList, getTranslator());
        nodeListCtr.setTableDataModel(nodeTableModel);
        nodeChoose.put("nodeTable", nodeListCtr.getInitialComponent());
    }
    // set main content to nodechoose, do not use wrapper
    main.setContent(nodeChoose);
}
Also used : CustomRenderColumnDescriptor(org.olat.core.gui.components.table.CustomRenderColumnDescriptor) TableController(org.olat.core.gui.components.table.TableController) ICourse(org.olat.course.ICourse) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) CourseNode(org.olat.course.nodes.CourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 5 with IndentedNodeRenderer

use of org.olat.course.assessment.IndentedNodeRenderer in project openolat by klemens.

the class GenericArchiveController method doNodeChoose.

/**
 * @param ureq
 */
private void doNodeChoose(UserRequest ureq, VelocityContainer nodeChoose) {
    // table configuraton
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setTableEmptyMessage(translate("nodesoverview.nonodes"));
    tableConfig.setDownloadOffered(false);
    tableConfig.setSortingEnabled(false);
    tableConfig.setDisplayTableHeader(true);
    tableConfig.setDisplayRowCount(false);
    tableConfig.setPageingEnabled(false);
    removeAsListenerAndDispose(nodeListCtr);
    nodeListCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
    listenTo(nodeListCtr);
    // table columns
    nodeListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.node", 0, null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new IndentedNodeRenderer()));
    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1, CMD_SELECT_NODE, getLocale()));
    // get list of course node data and populate table data model
    ICourse course = CourseFactory.loadCourse(ores);
    CourseNode rootNode = course.getRunStructure().getRootNode();
    List<AssessmentNodeData> nodesTableObjectArrayList = addNodesAndParentsToList(0, rootNode);
    // only populate data model if data available
    if (nodesTableObjectArrayList == null) {
        nodeChoose.contextPut("hasNodes", Boolean.FALSE);
    } else {
        nodeChoose.contextPut("hasNodes", Boolean.TRUE);
        nodeTableModel = new NodeTableDataModel(nodesTableObjectArrayList, getTranslator());
        nodeListCtr.setTableDataModel(nodeTableModel);
        nodeChoose.put("nodeTable", nodeListCtr.getInitialComponent());
    }
    // set main content to nodechoose, do not use wrapper
    main.setContent(nodeChoose);
}
Also used : CustomRenderColumnDescriptor(org.olat.core.gui.components.table.CustomRenderColumnDescriptor) TableController(org.olat.core.gui.components.table.TableController) ICourse(org.olat.course.ICourse) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) CourseNode(org.olat.course.nodes.CourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Aggregations

IndentedNodeRenderer (org.olat.course.assessment.IndentedNodeRenderer)6 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)4 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)4 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)4 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)4 ArrayList (java.util.ArrayList)2 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)2 CustomRenderColumnDescriptor (org.olat.core.gui.components.table.CustomRenderColumnDescriptor)2 DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)2 TableController (org.olat.core.gui.components.table.TableController)2 TableGuiConfiguration (org.olat.core.gui.components.table.TableGuiConfiguration)2 ICourse (org.olat.course.ICourse)2 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)2 AssessmentNodeData (org.olat.course.assessment.model.AssessmentNodeData)2 CourseNode (org.olat.course.nodes.CourseNode)2 TACourseNode (org.olat.course.nodes.TACourseNode)2 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)2