Search in sources :

Example 1 with CourseNodeEvent

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()));
                }
            }
        }
    }
}
Also used : TreeEvent(org.olat.core.gui.components.tree.TreeEvent) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) CourseNode(org.olat.course.nodes.CourseNode) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Example 2 with CourseNodeEvent

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);
}
Also used : TreeNode(org.olat.core.gui.components.tree.TreeNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Example 3 with CourseNodeEvent

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()));
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Example 4 with CourseNodeEvent

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()));
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Example 5 with CourseNodeEvent

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()));
                }
            }
        }
    }
}
Also used : TreeEvent(org.olat.core.gui.components.tree.TreeEvent) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) CourseNode(org.olat.course.nodes.CourseNode) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Aggregations

CourseNodeEvent (org.olat.course.assessment.ui.tool.event.CourseNodeEvent)6 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)6 CourseNode (org.olat.course.nodes.CourseNode)6 GTACourseNode (org.olat.course.nodes.GTACourseNode)4 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 TreeEvent (org.olat.core.gui.components.tree.TreeEvent)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 STCourseNode (org.olat.course.nodes.STCourseNode)2