use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class BaseFullWebappController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source instanceof Link) {
Link link = (Link) source;
String mC = link.getCommand().substring(0, 1);
if (mC.equals("t")) {
// activate normal tab
SiteInstance s = (SiteInstance) link.getUserObject();
// fix the state of the last tab/site
updateBusinessPath(ureq);
HistoryPoint point = null;
if (siteToBusinessPath.containsKey(s)) {
point = siteToBusinessPath.get(s);
}
activateSite(s, ureq, null, true);
if (point != null) {
BusinessControlFactory.getInstance().addToHistory(ureq, point);
}
updateBusinessPath(ureq, s);
} else if (mC.equals("a")) {
// activate dyntab
DTab dt = (DTab) link.getUserObject();
// fix the state of the last tab/site
updateBusinessPath(ureq);
HistoryPoint point = null;
if (dtabToBusinessPath.containsKey(dt)) {
point = dtabToBusinessPath.get(dt);
}
doActivateDTab(dt);
if (dt.getController() instanceof Activateable2) {
((Activateable2) dt.getController()).activate(ureq, null, new ReloadEvent());
}
if (point != null) {
BusinessControlFactory.getInstance().addToHistory(ureq, point);
}
} else if (mC.equals("c")) {
// close dyntab
DTab dt = (DTab) link.getUserObject();
requestCloseTab(ureq, dt);
}
} else if (source == getWindowControl().getWindowBackOffice().getWindow()) {
if (event == Window.OLDTIMESTAMPCALL) {
getLogger().info("RELOAD");
HistoryPoint point = ureq.getUserSession().popLastHistoryEntry();
if (point != null) {
back(ureq, point);
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class BaseFullWebappController method activateSite.
/**
* Activate a site if not locked
*
* @param s
* @param ureq
* @param entries
* @param forceReload
*/
private void activateSite(SiteInstance s, UserRequest ureq, List<ContextEntry> entries, boolean forceReload) {
if (lockResource != null)
return;
BornSiteInstance bs = siteToBornSite.get(s);
GuiStack gs;
Controller resC;
// PB//WindowControl site_wControl;
if (bs != null && s != curSite) {
// single - click -> fetch guistack from cache
gs = bs.getGuiStackHandle();
resC = bs.getController();
} else if (bs != null && s == curSite && !forceReload) {
// via activate, don't force the reload
gs = bs.getGuiStackHandle();
resC = bs.getController();
} else {
// dispose old controller
if (bs != null) {
// already in cache -> dispose old
bs.getController().dispose();
}
// reset site and create new controller
s.reset();
resC = s.createController(ureq, getWindowControl());
gs = getWindowControl().getWindowBackOffice().createGuiStack(resC.getInitialComponent());
// PB//site_wControl = bwControl;
// PB//siteToBornSite.put(s, new BornSiteInstance(gs, resC, bwControl));
siteToBornSite.put(s, new BornSiteInstance(gs, resC));
}
doActivateSite(s, gs);
if (resC instanceof Activateable2) {
((Activateable2) resC).activate(ureq, entries, null);
}
// perhaps has activation changed the gui stack and it need to be updated
setGuiStack(gs);
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class BusinessGroupMainRunController method doPortfolio.
private Activateable2 doPortfolio(UserRequest ureq) {
addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLPORTFOLIO, OlatResourceableType.portfolio));
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLPORTFOLIO);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(ce.getOLATResourceable()));
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createPortfolioController(ureq, bwControl, toolbarPanel, businessGroup);
listenTo(collabToolCtr);
toolbarPanel.popUpToRootController(ureq);
toolbarPanel.pushController("Portfolio", collabToolCtr);
List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType("Toc");
((Activateable2) collabToolCtr).activate(ureq, entries, null);
return (Activateable2) collabToolCtr;
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class BusinessGroupMainRunController method doAccessControlHistory.
private Activateable2 doAccessControlHistory(UserRequest ureq) {
removeAsListenerAndDispose(bgACHistoryCtrl);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ORES_TOOLBOOKING, null, getWindowControl());
addToHistory(ureq, bwControl);
OLATResource resource = businessGroup.getResource();
bgACHistoryCtrl = new OrdersAdminController(ureq, bwControl, toolbarPanel, resource);
listenTo(bgACHistoryCtrl);
mainPanel.setContent(bgACHistoryCtrl.getInitialComponent());
return (Activateable2) bgACHistoryCtrl;
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class AssessmentIdentityListCourseTreeController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (uo instanceof CourseNode) {
CourseNode cn = (CourseNode) uo;
Controller ctrl = doSelectCourseNode(ureq, cn);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, null);
}
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, cn.getIdent()));
}
}
}
}
Aggregations