use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method buildReviewSubTreeModel.
public void buildReviewSubTreeModel(TreeNode rootNode) {
if (!securityCallback.canUseReviewProcess())
return;
qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsReview(identity);
List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
if (!taxonomyLevels.isEmpty()) {
reviewNode = new GenericTreeNode(translator.translate("menu.review"));
reviewNode.setTitle(translator.translate("menu.review"));
rootNode.addChild(reviewNode);
for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
TreeNode node = new ReviewTreeNode(stackPanel, securityCallback, taxonomyLevel, identity, roles);
reviewNode.addChild(node);
}
setFirstChildAsDelegate(reviewNode);
}
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method buildMarkedTreeNode.
private void buildMarkedTreeNode(TreeNode parentNode) {
TreeNode node = new MarkedQuestionsTreeNode(stackPanel, securityCallback, translator.translate("menu.database.favorit"));
parentNode.addChild(node);
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method buildCollectionTreeNodes.
private void buildCollectionTreeNodes(TreeNode parentNode) {
if (!securityCallback.canUseCollections())
return;
List<QuestionItemCollection> collections = qpoolService.getCollections(identity).stream().sorted(Comparator.comparing(QuestionItemCollection::getName)).collect(Collectors.toList());
for (QuestionItemCollection coll : collections) {
TreeNode node = new CollectionTreeNode(stackPanel, securityCallback, coll);
parentNode.addChild(node);
}
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method buildPoolTreeNodes.
private void buildPoolTreeNodes(TreeNode parentNode) {
if (!securityCallback.canUsePools())
return;
List<Pool> pools = qpoolService.getPools(identity, roles).stream().sorted(Comparator.comparing(Pool::getName)).collect(Collectors.toList());
for (Pool pool : pools) {
TreeNode node = new PoolTreeNode(stackPanel, securityCallback, pool);
parentNode.addChild(node);
}
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method setFirstChildAsDelegate.
private void setFirstChildAsDelegate(INode node) {
if (node.getChildCount() > 0) {
INode childNode = node.getChildAt(0);
if (node instanceof GenericTreeNode && childNode instanceof TreeNode) {
GenericTreeNode parent = (GenericTreeNode) node;
TreeNode child = (TreeNode) childNode;
parent.setDelegate(child);
}
}
}
Aggregations