use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.
the class StepsMainRunController method event.
@Override
protected /*
* (non-Javadoc)
*
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
void event(final UserRequest ureq, Controller source, Event event) {
/*
* FIXME:pb:
*/
if (source == stepPagesController.peek()) {
if (event == StepsEvent.ACTIVATE_NEXT && !finishCycle) {
// intermediate steps wants to proceed - and next link was clicked
lastEvent = event;
doAfterDispatch = true;
// activate next event on source
Step current = steps.peek();
// TODO:pb detach previous from "submit" cycle
nextStep = current.nextStep();
if (nextStep == Step.NOSTEP) {
// next but no more step -> finish
finishWizard(ureq);
} else {
nextChildCreator = new ControllerCreator() {
private final UserRequest ureqForAfterDispatch = ureq;
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// taken
return nextStep.getStepController(ureqForAfterDispatch, lwControl, stepsContext, mainForm);
}
};
}
// creation of controller and setting the controller is deferred to
// the afterDispatch Cycle
//
} else if (event == StepsEvent.ACTIVATE_NEXT && finishCycle) {
// intermediate step wants to proceed - but finish link was clicked
// this means current step validated and we are ready to terminate
// the wizard.
finishWizard(ureq);
} else if (event == StepsEvent.INFORM_FINISHED) {
// finish link was clicked -> step form controller has valid data ->
// fires
// FINISH EVENT
// all relevant data for finishing the wizards work must now be
// present in the stepsContext
finishWizard(ureq);
}
}
}
use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.
the class TURunController method doLaunch.
private void doLaunch(UserRequest ureq) {
boolean iniframe = config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME);
// create the possibility to float
CloneableController controller;
if (iniframe) {
// Do not dispose this controller if the course is closed...
IframeTunnelController ifC = new IframeTunnelController(ureq, getWindowControl(), config);
controller = ifC;
} else {
TunnelController tuC = new TunnelController(ureq, getWindowControl(), config);
controller = tuC;
}
listenTo(controller);
// create clone wrapper layout
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(UserRequest ureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@SuppressWarnings("synthetic-access")
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// wrapp in column layout, popup window needs a layout controller
Controller ctr = contentControllerCreator.createController(lureq, lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), courseEnv));
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
}
};
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), controller, courseNode, "o_tu_icon");
if (ctrl instanceof CloneableController) {
cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
listenTo(cloneC);
main.setContent(cloneC.getInitialComponent());
} else {
throw new AssertException("Controller must be cloneable");
}
}
use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementsPortletRunController method event.
/**
* @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
super.event(ureq, source, event);
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_LAUNCH)) {
int rowid = te.getRowId();
final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
// will not be disposed on course run dispose, popus up as new browserwindow
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
pbw.open(ureq);
//
}
}
}
}
use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.
the class ParticipantLecturesOverviewController method doPrint.
private void doPrint(UserRequest ureq) {
ControllerCreator printControllerCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print");
Controller printCtrl = new ParticipantLecturesOverviewController(lureq, lwControl, assessedIdentity, false, false, false, true);
listenTo(printCtrl);
return printCtrl;
}
};
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator);
openInNewBrowserWindow(ureq, layoutCtrlr);
}
use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.
the class ParticipantListRepositoryController method doPrint.
private void doPrint(UserRequest ureq) {
ControllerCreator printControllerCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print");
Controller printCtrl = new ParticipantListRepositoryController(lureq, lwControl, entry, true, admin);
listenTo(printCtrl);
return printCtrl;
}
};
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator);
openInNewBrowserWindow(ureq, layoutCtrlr);
}
Aggregations