use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
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 MembersManagementMainController method buildTreeModel.
private GenericTreeModel buildTreeModel() {
GenericTreeModel gtm = new GenericTreeModel();
GenericTreeNode root = new GenericTreeNode();
root.setTitle(translate("menu.members"));
root.setAltText(translate("menu.members.alt"));
gtm.setRootNode(root);
if (entryAdmin || memberManagementRight) {
GenericTreeNode node = new GenericTreeNode(translate("menu.members"), CMD_MEMBERS);
node.setAltText(translate("menu.members.alt"));
node.setCssClass("o_sel_membersmgt_members");
root.addChild(node);
}
if (entryAdmin || memberManagementRight || groupManagementRight) {
GenericTreeNode node = new GenericTreeNode(translate("menu.groups"), CMD_GROUPS);
node.setAltText(translate("menu.groups.alt"));
node.setCssClass("o_sel_membersmgt_groups");
root.addChild(node);
}
if (acModule.isEnabled() && (entryAdmin || memberManagementRight)) {
// check if the course is managed and/or has offers
if (!RepositoryEntryManagedFlag.isManaged(repoEntry, RepositoryEntryManagedFlag.bookings) || acService.isResourceAccessControled(repoEntry.getOlatResource(), null)) {
GenericTreeNode node = new GenericTreeNode(translate("menu.orders"), CMD_BOOKING);
node.setAltText(translate("menu.orders.alt"));
node.setCssClass("o_sel_membersmgt_orders");
root.addChild(node);
}
}
if (entryAdmin) {
GenericTreeNode node = new GenericTreeNode(translate("menu.rights"), CMD_RIGHTS);
node.setAltText(translate("menu.rights.alt"));
node.setCssClass("o_sel_membersmgt_rights");
root.addChild(node);
}
return gtm;
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
the class CPTreeDataModel method addItem.
private void addItem(List<TreeNode> nodeList, CPItem item) throws JSONException {
String nId = putIdentifierForNodeID(item.getIdentifier());
GenericTreeNode child = new GenericTreeNode(nId, item.getTitle(), item);
child.setIconCssClass("o_cp_item");
nodeList.add(child);
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
the class WikiMainController method getAndUseExternalTree.
public GenericTreeModel getAndUseExternalTree() {
final String resId = ores.getResourceableId().toString();
Wiki wiki = getWiki();
wikiMenuModel = new GenericTreeModel();
String root = "wiki-" + resId;
GenericTreeNode rootNode = new GenericTreeNode(root);
wikiMenuModel.setRootNode(rootNode);
// Index
String navMainItem = "nav-main-item-" + resId;
navMainPageNode = new GenericTreeNode(navMainItem, translate("navigation.mainpage"), navMainItem);
rootNode.addChild(navMainPageNode);
// Wiki-Menu
String wikiMenuTitle = translate("navigation.menu");
String wikiMenuItem = "menu-item-" + resId;
wikiMenuNode = new GenericTreeNode(wikiMenuItem, wikiMenuTitle, wikiMenuItem);
rootNode.addChild(wikiMenuNode);
String navAZItem = "nav-az-item-" + resId;
navAZNode = new GenericTreeNode(navAZItem, translate("navigation.a-z"), navAZItem);
rootNode.addChild(navAZNode);
String navChangesItem = "nav-changes-item-" + resId;
navChangesNode = new GenericTreeNode(navChangesItem, translate("navigation.changes"), navChangesItem);
rootNode.addChild(navChangesNode);
updateWikiMenu(wiki);
navigationDropdown.setVisible(false);
wikiMenuDropdown.setVisible(false);
navigationContent.contextPut("navigationEnabled", Boolean.FALSE);
return wikiMenuModel;
}
use of org.olat.core.gui.components.tree.GenericTreeNode in project OpenOLAT by OpenOLAT.
the class QTI21StatisticResourceResult method buildRecursively.
private TreeNode buildRecursively(AssessmentItemRef itemRef, TreeNode parentNode) {
GenericTreeNode itemNode = new GenericTreeNode();
ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
BadResourceException ex = resolvedAssessmentItem.getItemLookup().getBadResourceException();
if (ex == null) {
AssessmentItem assessmentItem = resolvedAssessmentItem.getItemLookup().getRootNodeHolder().getRootNode();
itemNode.setTitle(assessmentItem.getTitle());
QTI21QuestionType type = QTI21QuestionType.getTypeRelax(assessmentItem);
if (type != null) {
itemNode.setIconCssClass("o_icon ".concat(type.getCssClass()));
} else {
itemNode.setIconCssClass("o_icon o_mi_qtiunkown");
}
itemNode.setUserObject(itemRef);
parentNode.addChild(itemNode);
}
return itemNode;
}
Aggregations