Search in sources :

Example 1 with EPReflexionChangeEvent

use of org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent in project OpenOLAT by OpenOLAT.

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;
    }
}
Also used : AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) EPReflexionChangeEvent(org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 2 with EPReflexionChangeEvent

use of org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent 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;
    }
}
Also used : AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) EPReflexionChangeEvent(org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Aggregations

AbstractArtefact (org.olat.portfolio.model.artefacts.AbstractArtefact)2 EPReflexionChangeEvent (org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent)2 EPStructureChangeEvent (org.olat.portfolio.ui.structel.EPStructureChangeEvent)2