Search in sources :

Example 26 with INode

use of org.olat.core.util.nodes.INode in project OpenOLAT by OpenOLAT.

the class QuestionPoolMenuTreeModel method reloadReviewCount.

private void reloadReviewCount(INode node) {
    for (int i = node.getChildCount(); i-- > 0; ) {
        INode child = node.getChildAt(i);
        if (child instanceof ReviewTreeNode) {
            ReviewTreeNode reviewTreeNode = (ReviewTreeNode) child;
            reviewTreeNode.reloadCount();
        }
        reloadReviewCount(child);
    }
}
Also used : INode(org.olat.core.util.nodes.INode)

Example 27 with INode

use of org.olat.core.util.nodes.INode in project OpenOLAT by OpenOLAT.

the class OLATUpgrade_11_0_0 method hasAssessableSTCourseNode.

private List<STCourseNode> hasAssessableSTCourseNode(ICourse course) {
    List<STCourseNode> assessableSTNodes = new ArrayList<>();
    CourseNode rootNode = course.getRunStructure().getRootNode();
    new TreeVisitor(new Visitor() {

        @Override
        public void visit(INode node) {
            if (node instanceof STCourseNode) {
                STCourseNode stNode = (STCourseNode) node;
                ScoreCalculator calculator = stNode.getScoreCalculator();
                if (StringHelper.containsNonWhitespace(calculator.getPassedExpression())) {
                    assessableSTNodes.add(stNode);
                } else if (StringHelper.containsNonWhitespace(calculator.getScoreExpression())) {
                    assessableSTNodes.add(stNode);
                }
            }
        }
    }, rootNode, true).visitAll();
    return assessableSTNodes;
}
Also used : TreeVisitor(org.olat.core.util.tree.TreeVisitor) INode(org.olat.core.util.nodes.INode) TreeVisitor(org.olat.core.util.tree.TreeVisitor) Visitor(org.olat.core.util.tree.Visitor) STCourseNode(org.olat.course.nodes.STCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) ScoreCalculator(org.olat.course.run.scoring.ScoreCalculator) ArrayList(java.util.ArrayList) STCourseNode(org.olat.course.nodes.STCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) CourseNode(org.olat.course.nodes.CourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) BasicLTICourseNode(org.olat.course.nodes.BasicLTICourseNode)

Example 28 with INode

use of org.olat.core.util.nodes.INode in project OpenOLAT by OpenOLAT.

the class MenuTree method handleDeselect.

private void handleDeselect(String nodeId) {
    TreeNode node = treeModel.getNodeById(nodeId);
    INode parentNode = node.getParent();
    if (parentNode != null) {
        setSelectedNodeId(parentNode.getIdent());
    } else {
        clearSelection();
    }
}
Also used : INode(org.olat.core.util.nodes.INode)

Example 29 with INode

use of org.olat.core.util.nodes.INode in project OpenOLAT by OpenOLAT.

the class NodeExportVisitor method visit.

private void visit(Visitor visitor, INode node) {
    visitor.visit(node);
    for (int i = node.getChildCount(); i-- > 0; ) {
        INode subNode = node.getChildAt(i);
        visit(visitor, subNode);
    }
}
Also used : INode(org.olat.core.util.nodes.INode)

Example 30 with INode

use of org.olat.core.util.nodes.INode in project openolat by klemens.

the class TreeVisitor method doVisit.

private void doVisit(INode node) {
    if (!visitChildrenFirst) {
        v.visit(node);
    }
    int chdCnt = node.getChildCount();
    for (int i = 0; i < chdCnt; i++) {
        INode chd = node.getChildAt(i);
        doVisit(chd);
    }
    if (visitChildrenFirst) {
        v.visit(node);
    }
}
Also used : INode(org.olat.core.util.nodes.INode)

Aggregations

INode (org.olat.core.util.nodes.INode)106 Visitor (org.olat.core.util.tree.Visitor)44 CourseNode (org.olat.course.nodes.CourseNode)44 ICourse (org.olat.course.ICourse)40 TreeVisitor (org.olat.core.util.tree.TreeVisitor)30 ArrayList (java.util.ArrayList)28 Identity (org.olat.core.id.Identity)26 CourseEditorTreeNode (org.olat.course.tree.CourseEditorTreeNode)24 TreeNode (org.olat.core.gui.components.tree.TreeNode)18 RepositoryEntry (org.olat.repository.RepositoryEntry)18 Test (org.junit.Test)16 BCCourseNode (org.olat.course.nodes.BCCourseNode)14 CourseTreeVisitor (org.olat.course.run.userview.CourseTreeVisitor)14 VisibleTreeFilter (org.olat.course.run.userview.VisibleTreeFilter)14 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)12 IdentityEnvironment (org.olat.core.id.IdentityEnvironment)12 CourseEditorTreeModel (org.olat.course.tree.CourseEditorTreeModel)12 HashMap (java.util.HashMap)10 FOCourseNode (org.olat.course.nodes.FOCourseNode)10 GET (javax.ws.rs.GET)8