use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
the class TaxonomyAllTreesBuilder method loadTreeModel.
public void loadTreeModel(GenericTreeModel taxonomyTreesModel, Taxonomy taxonomy) {
Map<Taxonomy, GenericTreeNode> rootNodesMap = new HashMap<>();
GenericTreeNode rootNode = new GenericTreeNode("taxonomy-" + taxonomy.getKey());
rootNode.setTitle(taxonomy.getDisplayName());
rootNode.setIconCssClass("o_icon_taxonomy");
rootNode.setUserObject(taxonomy);
taxonomyTreesModel.setRootNode(rootNode);
rootNodesMap.put(taxonomy, rootNode);
loadTreeModel(rootNodesMap, taxonomy);
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
the class WikiMainController method updateWikiMenu.
private void updateWikiMenu(Wiki wiki) {
Collection<String> links = wiki.getListOfAllPageNames();
if (wikiMenuNode != null) {
wikiMenuNode.removeAllChildren();
for (String link : links) {
String ident = "w" + Encoder.md5hash(link);
GenericTreeNode menuItemNode = new GenericTreeNode(ident, link, link);
wikiMenuNode.addChild(menuItemNode);
}
}
wikiMenuDropdown.removeAllComponents();
for (String link : links) {
Link menuLink = LinkFactory.createToolLink(link, "select-page", link, this);
wikiMenuDropdown.addComponent(menuLink);
}
if (editMenuButton != null) {
wikiMenuDropdown.addComponent(new Spacer("wiki-spacer"));
wikiMenuDropdown.addComponent(editMenuButton);
}
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
the class QuestionPoolMenuTreeModel method buildFinalSubTreeModel.
public void buildFinalSubTreeModel(TreeNode rootNode) {
if (!securityCallback.canUseReviewProcess())
return;
qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsFinal(identity);
List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
if (!taxonomyLevels.isEmpty()) {
finalNode = new GenericTreeNode(translator.translate("menu.final"));
finalNode.setTitle(translator.translate("menu.final"));
rootNode.addChild(finalNode);
for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
TreeNode node = new FinalTreeNode(stackPanel, securityCallback, taxonomyLevel);
finalNode.addChild(node);
}
setFirstChildAsDelegate(finalNode);
}
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.
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 klemens.
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