Search in sources :

Example 6 with OlatCmdEvent

use of org.olat.core.gui.components.htmlsite.OlatCmdEvent in project OpenOLAT by OpenOLAT.

the class ProjectBrokerPeekViewRunController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
        Link projectLink = (Link) source;
        String projectId = (String) projectLink.getUserObject();
        if (projectId == null) {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, courseNodeIdent));
        } else {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, courseNodeIdent + "/" + projectId));
        }
    }
}
Also used : OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent) Link(org.olat.core.gui.components.link.Link)

Example 7 with OlatCmdEvent

use of org.olat.core.gui.components.htmlsite.OlatCmdEvent in project openolat by klemens.

the class PFPeekviewController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
        Link nodeLink = (Link) source;
        String relPath = (String) nodeLink.getUserObject();
        if (relPath == null) {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));
        } else {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + relPath));
        }
    }
}
Also used : OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent) Link(org.olat.core.gui.components.link.Link)

Example 8 with OlatCmdEvent

use of org.olat.core.gui.components.htmlsite.OlatCmdEvent in project openolat by klemens.

the class FeedPeekviewController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.components.Component,
 *      org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
        Link nodeLink = (Link) source;
        String itemId = (String) nodeLink.getUserObject();
        if (itemId == null) {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));
        } else {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + itemId));
        }
    }
}
Also used : OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent) Link(org.olat.core.gui.components.link.Link)

Example 9 with OlatCmdEvent

use of org.olat.core.gui.components.htmlsite.OlatCmdEvent in project openolat by klemens.

the class BCPeekviewController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
        Link nodeLink = (Link) source;
        String relPath = (String) nodeLink.getUserObject();
        if (relPath == null) {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));
        } else {
            fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + relPath));
        }
    }
}
Also used : OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent) Link(org.olat.core.gui.components.link.Link)

Example 10 with OlatCmdEvent

use of org.olat.core.gui.components.htmlsite.OlatCmdEvent in project openolat by klemens.

the class PreviewRunController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == currentNodeController) {
        if (event instanceof OlatCmdEvent) {
            OlatCmdEvent oe = (OlatCmdEvent) event;
            String cmd = oe.getCommand();
            if (cmd.equals(OlatCmdEvent.GOTONODE_CMD)) {
                // "69680861018558";
                String subcmd = oe.getSubcommand();
                CourseNode identNode = uce.getCourseEnvironment().getRunStructure().getNode(subcmd);
                updateTreeAndContent(ureq, identNode);
                oe.accept();
            }
        } else if (RunMainController.REBUILD.equals(event.getCommand())) {
            updateTreeAndContent(ureq, currentCourseNode);
        }
    }
}
Also used : OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent) CourseNode(org.olat.course.nodes.CourseNode)

Aggregations

OlatCmdEvent (org.olat.core.gui.components.htmlsite.OlatCmdEvent)20 Link (org.olat.core.gui.components.link.Link)10 CourseNode (org.olat.course.nodes.CourseNode)4 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 NewIframeUriEvent (org.olat.core.gui.control.generic.iframe.NewIframeUriEvent)2 BusinessGroupModifiedEvent (org.olat.group.ui.edit.BusinessGroupModifiedEvent)2 TreeNodeEvent (org.olat.modules.cp.TreeNodeEvent)2