Search in sources :

Example 6 with ZIndexWrapper

use of org.olat.core.gui.control.util.ZIndexWrapper in project openolat by klemens.

the class GuiStackNiceImpl method pushCallout.

@Override
public void pushCallout(Component content, String targetId, CalloutSettings settings) {
    // wrap the component into a modal foreground dialog with alpha-blended-background
    final Panel guiMsgPlace = new Panel("guimsgplace_for_callout");
    VelocityContainer inset = new VelocityContainer("inset", VELOCITY_ROOT + "/callout.html", null, null) {

        public void validate(UserRequest ureq, ValidationResult vr) {
            super.validate(ureq, vr);
            // just before rendering, we need to tell the windowbackoffice that we are a favorite for accepting gui-messages.
            // the windowbackoffice doesn't know about guimessages, it is only a container that keeps them for one render cycle
            List<ZIndexWrapper> zindexed = wbo.getGuiMessages();
            zindexed.add(new ZIndexWrapper(guiMsgPlace, 10));
        }
    };
    inset.put("cont", content);
    inset.put("guimsgplace", guiMsgPlace);
    inset.contextPut("guimsgtarget", targetId);
    int zindex = 900 + (modalLayers * 100) + 5;
    inset.contextPut("zindexoverlay", zindex + 1);
    inset.contextPut("zindexshim", zindex);
    inset.contextPut("zindexarea", zindex + 5);
    inset.contextPut("zindexextwindows", zindex + 50);
    if (settings != null) {
        inset.contextPut("arrow", settings.isArrow());
        inset.contextPut("orientation", settings.getOrientation().name());
    } else {
        inset.contextPut("arrow", Boolean.TRUE);
        inset.contextPut("orientation", CalloutOrientation.bottom.name());
    }
    modalPanel.pushContent(inset);
    modalLayers++;
}
Also used : SimpleStackedPanel(org.olat.core.gui.components.panel.SimpleStackedPanel) LayeredPanel(org.olat.core.gui.components.panel.LayeredPanel) Panel(org.olat.core.gui.components.panel.Panel) StackedPanel(org.olat.core.gui.components.panel.StackedPanel) ZIndexWrapper(org.olat.core.gui.control.util.ZIndexWrapper) ValidationResult(org.olat.core.gui.render.ValidationResult) UserRequest(org.olat.core.gui.UserRequest) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

UserRequest (org.olat.core.gui.UserRequest)6 Panel (org.olat.core.gui.components.panel.Panel)6 StackedPanel (org.olat.core.gui.components.panel.StackedPanel)6 ZIndexWrapper (org.olat.core.gui.control.util.ZIndexWrapper)6 LayeredPanel (org.olat.core.gui.components.panel.LayeredPanel)4 SimpleStackedPanel (org.olat.core.gui.components.panel.SimpleStackedPanel)4 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)4 ValidationResult (org.olat.core.gui.render.ValidationResult)4 ChiefControllerMessageEvent (org.olat.core.commons.chiefcontrollers.ChiefControllerMessageEvent)2 LanguageChangedEvent (org.olat.core.commons.chiefcontrollers.LanguageChangedEvent)2 WindowManager (org.olat.core.gui.WindowManager)2 OncePanel (org.olat.core.gui.components.panel.OncePanel)2 ScrollTopCommand (org.olat.core.gui.control.winmgr.ScrollTopCommand)2 HistoryPoint (org.olat.core.id.context.HistoryPoint)2 AssertException (org.olat.core.logging.AssertException)2 AssessmentModeNotificationEvent (org.olat.course.assessment.AssessmentModeNotificationEvent)2