Search in sources :

Example 1 with DTabImpl

use of org.olat.core.gui.control.generic.dtabs.DTabImpl in project OpenOLAT by OpenOLAT.

the class BaseFullWebappController method activate.

/**
 * Activating a tab is like focusing a new window - we need to adjust the
 * guipath since e.g. the button triggering the activation is not
 * part of the guipath, but rather the new tab in its initial state.
 * in all other cases the "focus of interest" (where the calculation of the
 * guipath is started) matches the controller which listens to the
 * event caused by a user interaction.
 * this is the starting point.
 */
@Override
public void activate(UserRequest ureq, DTab dTab, List<ContextEntry> entries) {
    UserSession usess = ureq.getUserSession();
    if ((lockStatus != null || usess.isInAssessmentModeProcess()) && !usess.matchLockResource(dTab.getOLATResourceable())) {
        return;
    }
    // update window settings if needed
    setWindowSettings(getWindowControl().getWindowBackOffice().getWindowSettings());
    // jump here via external link or just open a new tab from e.g. repository
    if (dTab == null && contentCtrl instanceof Activateable2) {
        ((Activateable2) contentCtrl).activate(ureq, entries, null);
    } else {
        DTabImpl dtabi = (DTabImpl) dTab;
        Controller c = dtabi.getController();
        if (c == null) {
            throw new AssertException("no controller set yet! " + dTab);
        }
        doActivateDTab(dtabi);
        if (c instanceof Activateable2) {
            final Activateable2 activateable = ((Activateable2) c);
            activateable.activate(ureq, entries, null);
        }
        updateBusinessPath(ureq, dtabi);
        // update the panels after activation
        setGuiStack(dtabi.getGuiStackHandle());
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssertException(org.olat.core.logging.AssertException) UserSession(org.olat.core.util.UserSession) DTabImpl(org.olat.core.gui.control.generic.dtabs.DTabImpl) ResumeSessionController(org.olat.core.commons.controllers.resume.ResumeSessionController) AssessmentModeGuardController(org.olat.course.assessment.ui.mode.AssessmentModeGuardController) BasicController(org.olat.core.gui.control.controller.BasicController) ChiefController(org.olat.core.gui.control.ChiefController) BaseChiefController(org.olat.core.commons.chiefcontrollers.BaseChiefController) VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) Controller(org.olat.core.gui.control.Controller) UserToolsMenuController(org.olat.gui.control.UserToolsMenuController)

Example 2 with DTabImpl

use of org.olat.core.gui.control.generic.dtabs.DTabImpl in project OpenOLAT by OpenOLAT.

the class BaseFullWebappController method createDTab.

@Override
public DTab createDTab(OLATResourceable ores, OLATResourceable repoOres, Controller rootController, String title) {
    final DTabImpl dt;
    if (dtabs.size() >= maxTabs) {
        getWindowControl().setError(translate("warn.tabsfull"));
        dt = null;
    } else if (lockResource != null && (!lockResource.getResourceableId().equals(ores.getResourceableId()) || !lockResource.getResourceableTypeName().equals(ores.getResourceableTypeName()))) {
        dt = null;
    } else {
        dt = new DTabImpl(ores, repoOres, title, rootController, getWindowControl());
    }
    return dt;
}
Also used : DTabImpl(org.olat.core.gui.control.generic.dtabs.DTabImpl)

Example 3 with DTabImpl

use of org.olat.core.gui.control.generic.dtabs.DTabImpl in project openolat by klemens.

the class BaseFullWebappController method createDTab.

@Override
public DTab createDTab(OLATResourceable ores, OLATResourceable repoOres, Controller rootController, String title) {
    final DTabImpl dt;
    if (dtabs.size() >= maxTabs) {
        getWindowControl().setError(translate("warn.tabsfull"));
        dt = null;
    } else if (lockResource != null && (!lockResource.getResourceableId().equals(ores.getResourceableId()) || !lockResource.getResourceableTypeName().equals(ores.getResourceableTypeName()))) {
        dt = null;
    } else {
        dt = new DTabImpl(ores, repoOres, title, rootController, getWindowControl());
    }
    return dt;
}
Also used : DTabImpl(org.olat.core.gui.control.generic.dtabs.DTabImpl)

Example 4 with DTabImpl

use of org.olat.core.gui.control.generic.dtabs.DTabImpl in project openolat by klemens.

the class BaseFullWebappController method activate.

/**
 * Activating a tab is like focusing a new window - we need to adjust the
 * guipath since e.g. the button triggering the activation is not
 * part of the guipath, but rather the new tab in its initial state.
 * in all other cases the "focus of interest" (where the calculation of the
 * guipath is started) matches the controller which listens to the
 * event caused by a user interaction.
 * this is the starting point.
 */
@Override
public void activate(UserRequest ureq, DTab dTab, List<ContextEntry> entries) {
    UserSession usess = ureq.getUserSession();
    if ((lockStatus != null || usess.isInAssessmentModeProcess()) && !usess.matchLockResource(dTab.getOLATResourceable())) {
        return;
    }
    // update window settings if needed
    setWindowSettings(getWindowControl().getWindowBackOffice().getWindowSettings());
    // jump here via external link or just open a new tab from e.g. repository
    if (dTab == null && contentCtrl instanceof Activateable2) {
        ((Activateable2) contentCtrl).activate(ureq, entries, null);
    } else {
        DTabImpl dtabi = (DTabImpl) dTab;
        Controller c = dtabi.getController();
        if (c == null) {
            throw new AssertException("no controller set yet! " + dTab);
        }
        doActivateDTab(dtabi);
        if (c instanceof Activateable2) {
            final Activateable2 activateable = ((Activateable2) c);
            activateable.activate(ureq, entries, null);
        }
        updateBusinessPath(ureq, dtabi);
        // update the panels after activation
        setGuiStack(dtabi.getGuiStackHandle());
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssertException(org.olat.core.logging.AssertException) UserSession(org.olat.core.util.UserSession) DTabImpl(org.olat.core.gui.control.generic.dtabs.DTabImpl) ResumeSessionController(org.olat.core.commons.controllers.resume.ResumeSessionController) AssessmentModeGuardController(org.olat.course.assessment.ui.mode.AssessmentModeGuardController) BasicController(org.olat.core.gui.control.controller.BasicController) ChiefController(org.olat.core.gui.control.ChiefController) BaseChiefController(org.olat.core.commons.chiefcontrollers.BaseChiefController) VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) Controller(org.olat.core.gui.control.Controller) UserToolsMenuController(org.olat.gui.control.UserToolsMenuController)

Aggregations

DTabImpl (org.olat.core.gui.control.generic.dtabs.DTabImpl)4 BaseChiefController (org.olat.core.commons.chiefcontrollers.BaseChiefController)2 ResumeSessionController (org.olat.core.commons.controllers.resume.ResumeSessionController)2 ChiefController (org.olat.core.gui.control.ChiefController)2 Controller (org.olat.core.gui.control.Controller)2 VetoableCloseController (org.olat.core.gui.control.VetoableCloseController)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 AssertException (org.olat.core.logging.AssertException)2 UserSession (org.olat.core.util.UserSession)2 AssessmentModeGuardController (org.olat.course.assessment.ui.mode.AssessmentModeGuardController)2 UserToolsMenuController (org.olat.gui.control.UserToolsMenuController)2