use of org.olat.core.gui.control.generic.spacesaver.ShrinkController in project OpenOLAT by OpenOLAT.
the class GuiDemoFlexiFormMainController 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) {
// there are only events of type link from the demos navigation
if (source instanceof Link) {
Link sl = (Link) source;
// userobject tells which demo to activate
String uob = (String) sl.getUserObject();
if (uob != null) {
ControllerCreator cc = demos.get(uob);
// update source
VelocityContainer sourceVC = createVelocityContainer(uob);
ShrinkController sc = new ShrinkController(false, sourceVC, "toggle source");
sourceP.setContent(sc.getInitialComponent());
// cleanup former democontroller
if (demoController != null)
demoController.dispose();
contentP.popContent();
// create new demo controller
demoController = cc.createController(ureq, getWindowControl());
contentP.pushContent(demoController.getInitialComponent());
}
}
}
use of org.olat.core.gui.control.generic.spacesaver.ShrinkController in project openolat by klemens.
the class GuiDemoFlexiFormMainController 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) {
// there are only events of type link from the demos navigation
if (source instanceof Link) {
Link sl = (Link) source;
// userobject tells which demo to activate
String uob = (String) sl.getUserObject();
if (uob != null) {
ControllerCreator cc = demos.get(uob);
// update source
VelocityContainer sourceVC = createVelocityContainer(uob);
ShrinkController sc = new ShrinkController(false, sourceVC, "toggle source");
sourceP.setContent(sc.getInitialComponent());
// cleanup former democontroller
if (demoController != null)
demoController.dispose();
contentP.popContent();
// create new demo controller
demoController = cc.createController(ureq, getWindowControl());
contentP.pushContent(demoController.getInitialComponent());
}
}
}
Aggregations