use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
the class QTIStatisticResourceResult method buildQTICourseNodeSubTree.
private void buildQTICourseNodeSubTree(QTIDocument qtiDoc, GenericTreeNode rootNode) {
for (Section section : qtiDoc.getAssessment().getSections()) {
GenericTreeNode sectionNode = new SectionNode(section, null);
sectionNode.setUserObject(section);
rootNode.addChild(sectionNode);
for (Item item : section.getItems()) {
GenericTreeNode itemNode = new ItemNode(item);
itemNode.setIdent(Long.toString(CodeHelper.getForeverUniqueID()));
if (sectionNode.getDelegate() == null) {
sectionNode.setDelegate(itemNode);
}
itemNode.setUserObject(item);
sectionNode.addChild(itemNode);
}
}
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
the class NavigationHandler method copyIdent.
private void copyIdent(TreeNode guiNode, TreeNode originalNode) {
if (guiNode instanceof GenericTreeNode) {
((GenericTreeNode) guiNode).setIdent(originalNode.getIdent());
}
for (int i = originalNode.getChildCount(); i-- > 0; ) {
INode originalChild = originalNode.getChildAt(i);
INode guiChild = guiNode.getChildAt(i);
copyIdent((TreeNode) guiChild, (TreeNode) originalChild);
}
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
the class QuestionPoolMenuTreeModel method buildTreeModel.
private void buildTreeModel() {
TreeNode rootNode = new GenericTreeNode(translator.translate("topnav.qpool"));
setRootNode(rootNode);
// question database
myNode = new PresentationTreeNode(translator.translate("menu.database"));
rootNode.addChild(myNode);
buildMySubTreeModel();
// review process
buildReviewSubTreeModel(rootNode);
buildFinalSubTreeModel(rootNode);
// pools + shares
if (securityCallback.canUsePools() || securityCallback.canUseGroups()) {
sharesNode = new SharesTreeNode(translator.translate("menu.share"));
rootNode.addChild(sharesNode);
buildShareSubTreeModel();
setFirstChildAsDelegate(sharesNode);
}
buildPredifinedQueriesNode(rootNode);
// administration
TreeNode adminNode = new AdministrationTreeNode(translator.translate("menu.admin"));
rootNode.addChild(adminNode);
buildAdminSubTreeModel(adminNode);
if (adminNode.getChildCount() > 0) {
setFirstChildAsDelegate(adminNode);
} else {
// Admin tree node should not be visible if user has no particular admin rights.
rootNode.remove(adminNode);
}
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
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.GenericTreeNode in project OpenOLAT by OpenOLAT.
the class QuestionPoolMenuTreeModel method buildPredifinedQueriesNode.
private void buildPredifinedQueriesNode(TreeNode rootNode) {
if (!securityCallback.canEditAllQuestions())
return;
GenericTreeNode queriesNode = new GenericTreeNode(translator.translate("menu.queries"));
queriesNode.setTitle(translator.translate("menu.queries"));
rootNode.addChild(queriesNode);
TreeNode node = new AllQuestionsTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.all"));
queriesNode.addChild(node);
node = new WithoutTaxonomyLevelTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.without.taxonomy.level"));
queriesNode.addChild(node);
node = new WithoutAuthorTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.without.author"));
queriesNode.addChild(node);
setFirstChildAsDelegate(queriesNode);
}
Aggregations