Search in sources :

Example 1 with NewInlineUriEvent

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

the class CPDisplayController 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
public void event(UserRequest ureq, Component source, Event event) {
    if (source == cpTree) {
        // TreeEvent.dito...
        if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
            TreeEvent te = (TreeEvent) event;
            switchToPage(ureq, te);
        }
    } else if (source == cpComponent) {
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        }
    } else if (source == nextLink) {
        TreeNode nextUri = (TreeNode) nextLink.getUserObject();
        switchToPage(ureq, nextUri);
        if (cpTree != null) {
            cpTree.setSelectedNode(nextUri);
        }
        fireEvent(ureq, new TreeNodeEvent(nextUri));
    } else if (source == previousLink) {
        TreeNode previousUri = (TreeNode) previousLink.getUserObject();
        if (cpTree != null) {
            cpTree.setSelectedNode(previousUri);
        }
        switchToPage(ureq, previousUri);
        fireEvent(ureq, new TreeNodeEvent(previousUri));
    } else if (source == printLink) {
        selectPagesToPrint(ureq);
    }
}
Also used : TreeEvent(org.olat.core.gui.components.tree.TreeEvent) TreeNode(org.olat.core.gui.components.tree.TreeNode) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Example 2 with NewInlineUriEvent

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

the class CPDisplayController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cpContentCtr) {
        // a .html click within the contentpackage
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent nue = (NewIframeUriEvent) event;
            selectTreeNode(ureq, nue.getNewUri());
        }
    // else ignore (e.g. misplaced olatcmd event (inner olat link found in a
    // contentpackaging file)
    } else if (source == printPopup) {
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    } else if (source == printController) {
        if (Event.DONE_EVENT == event) {
            List<String> nodeToPrint = printController.getSelectedNodeIdentifiers();
            printPages(nodeToPrint);
        }
        printPopup.deactivate();
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Example 3 with NewInlineUriEvent

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

the class CPDisplayController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cpContentCtr) {
        // a .html click within the contentpackage
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent nue = (NewIframeUriEvent) event;
            selectTreeNode(ureq, nue.getNewUri());
        }
    // else ignore (e.g. misplaced olatcmd event (inner olat link found in a
    // contentpackaging file)
    } else if (source == printPopup) {
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    } else if (source == printController) {
        if (Event.DONE_EVENT == event) {
            List<String> nodeToPrint = printController.getSelectedNodeIdentifiers();
            printPages(nodeToPrint);
        }
        printPopup.deactivate();
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Example 4 with NewInlineUriEvent

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

the class CPDisplayController 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
public void event(UserRequest ureq, Component source, Event event) {
    if (source == cpTree) {
        // TreeEvent.dito...
        if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
            TreeEvent te = (TreeEvent) event;
            switchToPage(ureq, te);
        }
    } else if (source == cpComponent) {
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        }
    } else if (source == nextLink) {
        TreeNode nextUri = (TreeNode) nextLink.getUserObject();
        switchToPage(ureq, nextUri);
        if (cpTree != null) {
            cpTree.setSelectedNode(nextUri);
        }
        fireEvent(ureq, new TreeNodeEvent(nextUri));
    } else if (source == previousLink) {
        TreeNode previousUri = (TreeNode) previousLink.getUserObject();
        if (cpTree != null) {
            cpTree.setSelectedNode(previousUri);
        }
        switchToPage(ureq, previousUri);
        fireEvent(ureq, new TreeNodeEvent(previousUri));
    } else if (source == printLink) {
        selectPagesToPrint(ureq);
    }
}
Also used : TreeEvent(org.olat.core.gui.components.tree.TreeEvent) TreeNode(org.olat.core.gui.components.tree.TreeNode) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Aggregations

NewInlineUriEvent (org.olat.core.gui.components.htmlsite.NewInlineUriEvent)4 TreeEvent (org.olat.core.gui.components.tree.TreeEvent)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 NewIframeUriEvent (org.olat.core.gui.control.generic.iframe.NewIframeUriEvent)2