Search in sources :

Example 1 with EPArtefactDeletedEvent

use of org.olat.portfolio.ui.artefacts.view.EPArtefactDeletedEvent in project openolat by klemens.

the class EPArtefactPoolRunController 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) {
    super.event(ureq, source, event);
    if (source == addArtefactCtrl) {
        // some artefacts were added, refresh view
        if (event.equals(Event.DONE_EVENT)) {
            initTPAllView(ureq);
            fireEvent(ureq, event);
        }
    } else if (event instanceof EPArtefactChoosenEvent || event instanceof EPArtefactListChoosenEvent) {
        // an artefact was choosen, pass through the event until top
        fireEvent(ureq, event);
    } else if (source == filterSelectCtrl) {
        if (event instanceof PortfolioFilterChangeEvent) {
            PortfolioFilterChangeEvent pFEvent = (PortfolioFilterChangeEvent) event;
            filterSettings = pFEvent.getFilterList();
        } else if (event instanceof PortfolioFilterEditEvent) {
            PortfolioFilterEditEvent editEvent = (PortfolioFilterEditEvent) event;
            filterSettings = editEvent.getFilterList();
        }
        if (source instanceof EPFilterSelectController) {
            if (event == Event.CHANGED_EVENT) {
                initTPFilterView(ureq);
            } else if (event instanceof PortfolioFilterChangeEvent) {
                // preset search was selected, apply it, but stay within first segment
                initTPFilterView(ureq);
                initFilterPanel(ureq, Filter.read_only);
            } else if (event instanceof PortfolioFilterEditEvent) {
                initTPFilterView(ureq);
                initFilterPanel(ureq, Filter.extended);
                segmentView.select(searchLink);
            }
        } else if (source instanceof EPTagBrowseController) {
            if (event instanceof EPTagBrowseEvent) {
                EPTagBrowseEvent found = (EPTagBrowseEvent) event;
                initMultiArtefactCtrl(ureq, found.getArtefacts());
                setSegmentContent(artCtrl);
            }
        } else if (source instanceof PortfolioFilterController) {
            if (event instanceof PortfolioFilterChangeEvent) {
                initTPFilterView(ureq);
            }
        }
    } else if (source == viewModeCtrl && event.getCommand().equals(EPViewModeController.VIEWMODE_CHANGED_EVENT_CMD)) {
        initMultiArtefactCtrl(ureq, previousArtefactsList);
        setSegmentContent(artCtrl);
    } else if (event instanceof EPArtefactDeletedEvent) {
        EPArtefactDeletedEvent epDelEv = (EPArtefactDeletedEvent) event;
        previousArtefactsList.remove(epDelEv.getArtefact());
        initMultiArtefactCtrl(ureq, previousArtefactsList);
        setSegmentContent(artCtrl);
    }
}
Also used : EPFilterSelectController(org.olat.portfolio.ui.filter.EPFilterSelectController) EPTagBrowseEvent(org.olat.portfolio.ui.artefacts.view.EPTagBrowseEvent) PortfolioFilterEditEvent(org.olat.portfolio.ui.filter.PortfolioFilterEditEvent) PortfolioFilterController(org.olat.portfolio.ui.filter.PortfolioFilterController) EPArtefactDeletedEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactDeletedEvent) PortfolioFilterChangeEvent(org.olat.portfolio.ui.filter.PortfolioFilterChangeEvent) EPArtefactListChoosenEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactListChoosenEvent) EPTagBrowseController(org.olat.portfolio.ui.artefacts.view.EPTagBrowseController) EPArtefactChoosenEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactChoosenEvent)

Example 2 with EPArtefactDeletedEvent

use of org.olat.portfolio.ui.artefacts.view.EPArtefactDeletedEvent in project OpenOLAT by OpenOLAT.

the class EPArtefactPoolRunController 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) {
    super.event(ureq, source, event);
    if (source == addArtefactCtrl) {
        // some artefacts were added, refresh view
        if (event.equals(Event.DONE_EVENT)) {
            initTPAllView(ureq);
            fireEvent(ureq, event);
        }
    } else if (event instanceof EPArtefactChoosenEvent || event instanceof EPArtefactListChoosenEvent) {
        // an artefact was choosen, pass through the event until top
        fireEvent(ureq, event);
    } else if (source == filterSelectCtrl) {
        if (event instanceof PortfolioFilterChangeEvent) {
            PortfolioFilterChangeEvent pFEvent = (PortfolioFilterChangeEvent) event;
            filterSettings = pFEvent.getFilterList();
        } else if (event instanceof PortfolioFilterEditEvent) {
            PortfolioFilterEditEvent editEvent = (PortfolioFilterEditEvent) event;
            filterSettings = editEvent.getFilterList();
        }
        if (source instanceof EPFilterSelectController) {
            if (event == Event.CHANGED_EVENT) {
                initTPFilterView(ureq);
            } else if (event instanceof PortfolioFilterChangeEvent) {
                // preset search was selected, apply it, but stay within first segment
                initTPFilterView(ureq);
                initFilterPanel(ureq, Filter.read_only);
            } else if (event instanceof PortfolioFilterEditEvent) {
                initTPFilterView(ureq);
                initFilterPanel(ureq, Filter.extended);
                segmentView.select(searchLink);
            }
        } else if (source instanceof EPTagBrowseController) {
            if (event instanceof EPTagBrowseEvent) {
                EPTagBrowseEvent found = (EPTagBrowseEvent) event;
                initMultiArtefactCtrl(ureq, found.getArtefacts());
                setSegmentContent(artCtrl);
            }
        } else if (source instanceof PortfolioFilterController) {
            if (event instanceof PortfolioFilterChangeEvent) {
                initTPFilterView(ureq);
            }
        }
    } else if (source == viewModeCtrl && event.getCommand().equals(EPViewModeController.VIEWMODE_CHANGED_EVENT_CMD)) {
        initMultiArtefactCtrl(ureq, previousArtefactsList);
        setSegmentContent(artCtrl);
    } else if (event instanceof EPArtefactDeletedEvent) {
        EPArtefactDeletedEvent epDelEv = (EPArtefactDeletedEvent) event;
        previousArtefactsList.remove(epDelEv.getArtefact());
        initMultiArtefactCtrl(ureq, previousArtefactsList);
        setSegmentContent(artCtrl);
    }
}
Also used : EPFilterSelectController(org.olat.portfolio.ui.filter.EPFilterSelectController) EPTagBrowseEvent(org.olat.portfolio.ui.artefacts.view.EPTagBrowseEvent) PortfolioFilterEditEvent(org.olat.portfolio.ui.filter.PortfolioFilterEditEvent) PortfolioFilterController(org.olat.portfolio.ui.filter.PortfolioFilterController) EPArtefactDeletedEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactDeletedEvent) PortfolioFilterChangeEvent(org.olat.portfolio.ui.filter.PortfolioFilterChangeEvent) EPArtefactListChoosenEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactListChoosenEvent) EPTagBrowseController(org.olat.portfolio.ui.artefacts.view.EPTagBrowseController) EPArtefactChoosenEvent(org.olat.portfolio.ui.artefacts.view.EPArtefactChoosenEvent)

Aggregations

EPArtefactChoosenEvent (org.olat.portfolio.ui.artefacts.view.EPArtefactChoosenEvent)2 EPArtefactDeletedEvent (org.olat.portfolio.ui.artefacts.view.EPArtefactDeletedEvent)2 EPArtefactListChoosenEvent (org.olat.portfolio.ui.artefacts.view.EPArtefactListChoosenEvent)2 EPTagBrowseController (org.olat.portfolio.ui.artefacts.view.EPTagBrowseController)2 EPTagBrowseEvent (org.olat.portfolio.ui.artefacts.view.EPTagBrowseEvent)2 EPFilterSelectController (org.olat.portfolio.ui.filter.EPFilterSelectController)2 PortfolioFilterChangeEvent (org.olat.portfolio.ui.filter.PortfolioFilterChangeEvent)2 PortfolioFilterController (org.olat.portfolio.ui.filter.PortfolioFilterController)2 PortfolioFilterEditEvent (org.olat.portfolio.ui.filter.PortfolioFilterEditEvent)2