use of org.olat.course.assessment.ui.tool.event.CourseNodeEvent in project OpenOLAT by OpenOLAT.
the class CourseNodeSelectionController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event instanceof TreeEvent) {
TreeEvent te = (TreeEvent) event;
if (TreeEvent.COMMAND_TREENODE_OPEN.equals(te.getSubCommand()) || TreeEvent.COMMAND_TREENODE_CLOSE.equals(te.getSubCommand())) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (menuTree.getSelectedNode() == menuTree.getTreeModel().getRootNode()) {
// do nothing
} else if (uo instanceof AssessableCourseNode && !(uo instanceof STCourseNode)) {
AssessableCourseNode selectedNode = (AssessableCourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, selectedNode.getIdent()));
}
} else if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (menuTree.getSelectedNode() == menuTree.getTreeModel().getRootNode()) {
CourseNode rootNode = (CourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, rootNode.getIdent()));
} else if (uo instanceof AssessableCourseNode && !(uo instanceof STCourseNode)) {
AssessableCourseNode selectedNode = (AssessableCourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, selectedNode.getIdent()));
}
}
}
}
}
use of org.olat.course.assessment.ui.tool.event.CourseNodeEvent in project OpenOLAT by OpenOLAT.
the class AssessmentCourseTreeController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == businessGroupListCtrl) {
if (event instanceof CourseNodeEvent) {
CourseNodeEvent cne = (CourseNodeEvent) event;
CourseNode courseNode = CourseFactory.loadCourse(courseEntry).getRunStructure().getNode(cne.getIdent());
TreeNode treeNode = TreeHelper.findNodeByUserObject(courseNode, menuTree.getTreeModel().getRootNode());
if (treeNode == null) {
treeNode = menuTree.getTreeModel().getRootNode();
courseNode = CourseFactory.loadCourse(courseEntry).getRunStructure().getRootNode();
doSelectCourseNode(ureq, treeNode, courseNode);
menuTree.setSelectedNode(treeNode);
showWarning("warning.course.node.deleted");
} else {
stackPanel.changeDisplayname(treeNode.getTitle(), "o_icon " + treeNode.getIconCssClass(), this);
selectedNodeChanged = treeNode;
}
}
}
super.event(ureq, source, event);
}
use of org.olat.course.assessment.ui.tool.event.CourseNodeEvent in project openolat by klemens.
the class AssessmentIdentityListCourseTreeController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (uo instanceof CourseNode) {
CourseNode cn = (CourseNode) uo;
Controller ctrl = doSelectCourseNode(ureq, cn);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, null);
}
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, cn.getIdent()));
}
}
}
}
use of org.olat.course.assessment.ui.tool.event.CourseNodeEvent in project OpenOLAT by OpenOLAT.
the class AssessmentIdentityListCourseTreeController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (uo instanceof CourseNode) {
CourseNode cn = (CourseNode) uo;
Controller ctrl = doSelectCourseNode(ureq, cn);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, null);
}
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, cn.getIdent()));
}
}
}
}
use of org.olat.course.assessment.ui.tool.event.CourseNodeEvent in project openolat by klemens.
the class CourseNodeSelectionController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event instanceof TreeEvent) {
TreeEvent te = (TreeEvent) event;
if (TreeEvent.COMMAND_TREENODE_OPEN.equals(te.getSubCommand()) || TreeEvent.COMMAND_TREENODE_CLOSE.equals(te.getSubCommand())) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (menuTree.getSelectedNode() == menuTree.getTreeModel().getRootNode()) {
// do nothing
} else if (uo instanceof AssessableCourseNode && !(uo instanceof STCourseNode)) {
AssessableCourseNode selectedNode = (AssessableCourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, selectedNode.getIdent()));
}
} else if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (menuTree.getSelectedNode() == menuTree.getTreeModel().getRootNode()) {
CourseNode rootNode = (CourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, rootNode.getIdent()));
} else if (uo instanceof AssessableCourseNode && !(uo instanceof STCourseNode)) {
AssessableCourseNode selectedNode = (AssessableCourseNode) uo;
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, selectedNode.getIdent()));
}
}
}
}
}
Aggregations