use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.
the class EPCollectStepForm04 method formOK.
/**
* @see org.olat.core.gui.control.generic.wizard.StepFormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
@Override
protected void formOK(UserRequest ureq) {
PortfolioStructure selectedPortfolioStructure = preSelectedStructure;
TreeNode node = mapsTreeController == null ? null : mapsTreeController.getSelectedNode();
if (node != null) {
Object obj = node.getUserObject();
if (obj == null) {
selectedPortfolioStructure = null;
} else if (obj instanceof PortfolioStructure && !(obj instanceof EPAbstractMap)) {
selectedPortfolioStructure = (PortfolioStructure) obj;
}
}
if (selectedPortfolioStructure != null) {
ePFMgr.setUsersLastUsedPortfolioStructure(getIdentity(), selectedPortfolioStructure);
}
if (isUsedInStepWizzard()) {
addToRunContext("selectedStructure", selectedPortfolioStructure);
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
} else {
if (selectedPortfolioStructure != null && !selectedPortfolioStructure.getKey().equals(oldStructure.getKey())) {
ePFMgr.moveArtefactFromStructToStruct(artefact, oldStructure, selectedPortfolioStructure);
// refresh ui
fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.CHANGED, selectedPortfolioStructure));
}
}
}
use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.
the class EPReflexionWrapperController method event.
/**
* @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)
*/
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == reflexionCtrl && event instanceof EPReflexionChangeEvent) {
EPReflexionChangeEvent refEv = (EPReflexionChangeEvent) event;
if (struct != null) {
ePFMgr.setReflexionForArtefactToStructureLink(refEv.getRefArtefact(), struct, refEv.getReflexion());
reflexionBox.deactivate();
fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.ADDED, struct));
} else {
AbstractArtefact refArtefact = refEv.getRefArtefact();
refArtefact.setReflexion(refEv.getReflexion());
ePFMgr.updateArtefact(refArtefact);
reflexionBox.deactivate();
fireEvent(ureq, Event.DONE_EVENT);
}
removeAsListenerAndDispose(reflexionBox);
} else if (source == reflexionBox && event == CloseableCalloutWindowController.CLOSE_WINDOW_EVENT) {
removeAsListenerAndDispose(reflexionBox);
reflexionBox = null;
}
}
Aggregations