Search in sources :

Example 1 with TooledController

use of org.olat.core.gui.components.stack.TooledController in project openolat by klemens.

the class StatisticCourseNodesController method doSelectNode.

private void doSelectNode(UserRequest ureq, TreeNode selectedNode) {
    removeAsListenerAndDispose(currentCtrl);
    currentCtrl = null;
    WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstanceWithoutCheck(selectedNode.getIdent(), 0l), null);
    if (selectedNode instanceof StatisticResourceNode) {
        StatisticResourceNode node = (StatisticResourceNode) selectedNode;
        currentCtrl = node.getResult().getController(ureq, swControl, stackPanel, node);
    } else {
        StatisticResourceNode node = getStatisticNodeInParentLine(selectedNode);
        if (node != null) {
            currentCtrl = node.getResult().getController(ureq, swControl, stackPanel, selectedNode);
        }
    }
    if (currentCtrl != null) {
        listenTo(currentCtrl);
        layoutCtr.setCol3(currentCtrl.getInitialComponent());
        if (currentCtrl instanceof TooledController) {
            ((TooledController) currentCtrl).initTools();
        }
    } else {
        layoutCtr.setCol3(new Panel("empty"));
    }
    // also select in GUI
    courseTree.setSelectedNode(selectedNode);
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Panel(org.olat.core.gui.components.panel.Panel) WindowControl(org.olat.core.gui.control.WindowControl) TooledController(org.olat.core.gui.components.stack.TooledController)

Example 2 with TooledController

use of org.olat.core.gui.components.stack.TooledController in project OpenOLAT by OpenOLAT.

the class StatisticCourseNodesController method doSelectNode.

private void doSelectNode(UserRequest ureq, TreeNode selectedNode) {
    removeAsListenerAndDispose(currentCtrl);
    currentCtrl = null;
    WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstanceWithoutCheck(selectedNode.getIdent(), 0l), null);
    if (selectedNode instanceof StatisticResourceNode) {
        StatisticResourceNode node = (StatisticResourceNode) selectedNode;
        currentCtrl = node.getResult().getController(ureq, swControl, stackPanel, node);
    } else {
        StatisticResourceNode node = getStatisticNodeInParentLine(selectedNode);
        if (node != null) {
            currentCtrl = node.getResult().getController(ureq, swControl, stackPanel, selectedNode);
        }
    }
    if (currentCtrl != null) {
        listenTo(currentCtrl);
        layoutCtr.setCol3(currentCtrl.getInitialComponent());
        if (currentCtrl instanceof TooledController) {
            ((TooledController) currentCtrl).initTools();
        }
    } else {
        layoutCtr.setCol3(new Panel("empty"));
    }
    // also select in GUI
    courseTree.setSelectedNode(selectedNode);
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Panel(org.olat.core.gui.components.panel.Panel) WindowControl(org.olat.core.gui.control.WindowControl) TooledController(org.olat.core.gui.components.stack.TooledController)

Aggregations

Panel (org.olat.core.gui.components.panel.Panel)2 TooledController (org.olat.core.gui.components.stack.TooledController)2 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)2 WindowControl (org.olat.core.gui.control.WindowControl)2