Search in sources :

Example 76 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class GuiDemoCalloutWindowController 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 == calloutTriggerLink) {
        if (calloutCtr == null) {
            // Open callout window and provide a DOM trigger ID manually from a
            // link. The content is a little two step workflow (user search)
            UserSearchController ctr = new UserSearchController(ureq, getWindowControl(), false);
            calloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), ctr.getInitialComponent(), "o_c" + calloutTriggerLink.getDispatchID(), null, true, null);
            calloutCtr.addDisposableChildController(ctr);
            calloutCtr.activate();
            listenTo(calloutCtr);
        } else {
            // When window is already opened, second click on trigger should close
            // it again.
            removeAsListenerAndDispose(calloutCtr);
            calloutCtr = null;
        }
    } else if (source == calloutTriggerLink2) {
        if (calloutCtr2 == null) {
            // Open callout window and provide a DOM trigger link. The content is
            // some static text.
            TextComponent calloutPanel = TextFactory.createTextComponentFromString("bla", "Just some random text here<br />Note that this window has no close button! <br /><br /><b>Click the button a second time to close this window.</b>", null, false, null);
            calloutCtr2 = new CloseableCalloutWindowController(ureq, getWindowControl(), calloutPanel, calloutTriggerLink2, "This is a title in a callout window", false, null);
            calloutCtr2.activate();
            listenTo(calloutCtr2);
        } else {
            // When window is already opened, second click on trigger should close
            // it again.
            removeAsListenerAndDispose(calloutCtr2);
            calloutCtr2 = null;
        }
    } else if (source == contentVC) {
        // callout window
        if ("trigger3".equals(event.getCommand())) {
            if (calloutCtr3 == null) {
                // open callout window
                TextComponent calloutPanel = TextFactory.createTextComponentFromString("blu", "Cras dictum. Maecenas ut turpis. In vitae erat ac orci dignissim eleifend. Nunc quis justo. Sed vel ipsum in purus tincidunt pharetra. Sed pulvinar, felis id consectetuer malesuada, enim nisl mattis elit, a facilisis tortor nibh quis leo. Sed augue lacus, pretium vitae, molestie eget, rhoncus quis, elit. Donec in augue. Fusce orci wisi, ornare id, mollis vel, lacinia vel, massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.", "o_error", false, null);
                calloutCtr3 = new CloseableCalloutWindowController(ureq, getWindowControl(), calloutPanel, "myspecialdomid", null, true, "trigger3");
                calloutCtr3.activate();
                listenTo(calloutCtr3);
            } else {
                // When window is already opened, second click on trigger should close
                // it again.
                removeAsListenerAndDispose(calloutCtr3);
                calloutCtr3 = null;
            }
        }
    }
}
Also used : TextComponent(org.olat.core.gui.components.text.TextComponent) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) UserSearchController(org.olat.admin.user.UserSearchController)

Example 77 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class BGConfigResourcesStepController method doOpenInfos.

private void doOpenInfos(UserRequest ureq, RepositoryEntry repositoryEntry, int rowId) {
    removeAsListenerAndDispose(calloutCtrl);
    removeAsListenerAndDispose(infosCtrl);
    infosCtrl = new RepositoryEntrySmallDetailsController(ureq, getWindowControl(), repositoryEntry);
    listenTo(infosCtrl);
    calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), infosCtrl.getInitialComponent(), "ore" + rowId + "ref", null, true, null);
    listenTo(calloutCtrl);
    calloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) RepositoryEntrySmallDetailsController(org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)

Example 78 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class CalendarPersonalConfigurationController method doTools.

private void doTools(UserRequest ureq, FormLink link, CalendarPersonalConfigurationRow row) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(calendarToolsCtrl);
    calendarToolsCtrl = new CalendarToolsController(ureq, getWindowControl(), row);
    listenTo(calendarToolsCtrl);
    calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), calendarToolsCtrl.getInitialComponent(), link.getFormDispatchId(), "", true, "");
    listenTo(calloutCtrl);
    calloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)

Example 79 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class WeeklyCalendarController method doOpenEventCallout.

private void doOpenEventCallout(UserRequest ureq, KalendarEvent calEvent, KalendarRenderWrapper calWrapper, String targetDomId) {
    if (eventCalloutCtr != null && eventDetailsCtr != null)
        return;
    removeAsListenerAndDispose(eventCalloutCtr);
    removeAsListenerAndDispose(eventDetailsCtr);
    eventDetailsCtr = new CalendarDetailsController(ureq, getWindowControl(), calEvent, calWrapper);
    listenTo(eventDetailsCtr);
    Component eventCmp = eventDetailsCtr.getInitialComponent();
    eventCalloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), eventCmp, targetDomId, "Event", true, "o_cal_event_callout");
    listenTo(eventCalloutCtr);
    eventCalloutCtr.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) Component(org.olat.core.gui.components.Component)

Example 80 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class LinkFileCombiCalloutController method doOpenCallout.

private void doOpenCallout(UserRequest ureq) {
    if (combiWindowController == null) {
        // Create file combi and callout controller only once. Later on
        // use activate and deactivate to show/hide the callout
        combiWindowController = new FileCombiCalloutWindowController(ureq, getWindowControl());
        calloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), combiWindowController.getInitialComponent(), "o_c" + calloutTriggerLink.getDispatchID(), null, true, null);
        listenTo(combiWindowController);
        listenTo(calloutCtr);
    }
    calloutCtr.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)

Aggregations

CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)122 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)8 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Component (org.olat.core.gui.components.Component)6 Link (org.olat.core.gui.components.link.Link)6 Identity (org.olat.core.id.Identity)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 RepositoryEntrySmallDetailsController (org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)6 UserSearchController (org.olat.admin.user.UserSearchController)4 CalloutSettings (org.olat.core.gui.control.generic.closablewrapper.CalloutSettings)4 NamingException (javax.naming.NamingException)2 LdapContext (javax.naming.ldap.LdapContext)2 KalendarRenderWrapper (org.olat.commons.calendar.ui.components.KalendarRenderWrapper)2 UserRequest (org.olat.core.gui.UserRequest)2 Choice (org.olat.core.gui.components.choice.Choice)2 FormToggle (org.olat.core.gui.components.form.flexible.elements.FormToggle)2 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)2 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)2