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);
}
}
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;
}
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();
}
}
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);
}
}
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);
}
}
Aggregations