use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class AssessmentCourseTreeController method switchToUsersView.
/**
* Switch to the user list
*
* @param ureq
* @param stateOfUserList Optional
*/
protected void switchToUsersView(UserRequest ureq, StateEntry stateOfUserList) {
view = View.users;
TreeNode treeNode = menuTree.getSelectedNode();
CourseNode courseNode = (CourseNode) treeNode.getUserObject();
Controller ctrl = doSelectCourseNode(ureq, treeNode, courseNode);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, stateOfUserList);
}
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class CourseInternalLinkTreeModel method findNode.
/**
* Depth-first traversal.
*
* @param nodeId
* @param node
* @return the treenode with the node id or null if not found
*/
private TreeNode findNode(String nodeId, TreeNode node) {
if (node.getIdent().equals(nodeId))
return node;
int childcnt = node.getChildCount();
for (int i = 0; i < childcnt; i++) {
TreeNode child = (TreeNode) node.getChildAt(i);
TreeNode result = findNode(nodeId, child);
if (result != null)
return result;
}
return null;
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QTI12PrintController method initView.
private void initView(UserRequest ureq, QTIStatisticResourceResult resourceResult) {
StatisticResourceNode rootNode = (StatisticResourceNode) resourceResult.getSubTreeModel().getRootNode();
ICourse course = CourseFactory.loadCourse(resourceResult.getCourseOres());
mainVC.contextPut("courseTitle", course.getCourseTitle());
String testTitle = resourceResult.getQTIRepositoryEntry().getDisplayname();
mainVC.contextPut("testTitle", testTitle);
int count = 0;
List<String> pageNames = new ArrayList<>();
Controller assessmentCtrl = resourceResult.getController(ureq, getWindowControl(), null, rootNode, true);
String pageName = "page" + count++;
mainVC.put(pageName, assessmentCtrl.getInitialComponent());
pageNames.add(pageName);
for (int i = 0; i < rootNode.getChildCount(); i++) {
INode sectionNode = rootNode.getChildAt(i);
for (int j = 0; j < sectionNode.getChildCount(); j++) {
TreeNode itemNode = (TreeNode) sectionNode.getChildAt(j);
Controller itemCtrl = resourceResult.getController(ureq, getWindowControl(), null, itemNode, true);
String itemPageName = "page" + count++;
mainVC.put(itemPageName, itemCtrl.getInitialComponent());
pageNames.add(itemPageName);
}
}
mainVC.contextPut("pageNames", pageNames);
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QTI12StatisticsToolController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
ContextEntry entry = entries.get(0);
if (entry.getOLATResourceable() != null && entry.getOLATResourceable().getResourceableTypeName() != null) {
String nodeId = entry.getOLATResourceable().getResourceableTypeName();
TreeNode nclr = courseTree.getTreeModel().getNodeById(nodeId);
if (nclr != null) {
String selNodeId = nclr.getIdent();
courseTree.setSelectedNodeId(selNodeId);
doSelectNode(ureq, nclr);
}
}
}
use of org.olat.core.gui.components.tree.TreeNode in project openolat by klemens.
the class QTI12StatisticsToolController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (courseTree == source) {
if (event instanceof TreeEvent) {
TreeEvent te = (TreeEvent) event;
if (MenuTree.COMMAND_TREENODE_CLICKED.equals(te.getCommand())) {
String ident = te.getNodeId();
TreeNode selectedNode = courseTree.getTreeModel().getNodeById(ident);
doSelectNode(ureq, selectedNode);
}
}
}
}
Aggregations