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());
}
}
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;
}
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;
}
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());
}
}
Aggregations