Search in sources :

Example 6 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project OpenOLAT by OpenOLAT.

the class EPArtefactViewOptionsLinkController 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 == moveTreeCtrl && event.getCommand().equals(EPStructureChangeEvent.CHANGED)) {
        EPStructureChangeEvent epsEv = (EPStructureChangeEvent) event;
        PortfolioStructure newStruct = epsEv.getPortfolioStructure();
        showInfo("artefact.moved", newStruct.getTitle());
        moveTreeBox.deactivate();
    } else if (source == artefactOptionCalloutCtrl) {
        removeAsListenerAndDispose(artefactOptionCalloutCtrl);
        artefactOptionCalloutCtrl = null;
    } else if (source == tagsCtrl) {
        if (event == Event.DONE_EVENT) {
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        removeAsListenerAndDispose(tagsCtrl);
    }
    fireEvent(ureq, event);
}
Also used : PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 7 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project OpenOLAT by OpenOLAT.

the class EPArtefactViewOptionsLinkController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == optionLink) {
        popUpArtefactOptionsBox(ureq);
    } else if (source == unlinkLink) {
        closeArtefactOptionsCallout();
        struct = ePFMgr.removeArtefactFromStructure(artefact, struct);
        // refresh ui
        fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.REMOVED, struct));
    } else if (source == moveLink) {
        closeArtefactOptionsCallout();
        showMoveTree(ureq);
    } else if (source == reflexionLink) {
        closeArtefactOptionsCallout();
        reflexionCtrl = new EPReflexionWrapperController(ureq, getWindowControl(), secCallback, artefact, struct);
        listenTo(reflexionCtrl);
    } else if (source == tagsLink) {
        closeArtefactOptionsCallout();
        tagsCtrl = new EPTagsController(ureq, getWindowControl(), secCallback, artefact, struct);
        listenTo(tagsCtrl);
    }
}
Also used : EPTagsController(org.olat.portfolio.ui.artefacts.edit.EPTagsController) EPReflexionWrapperController(org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 8 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.

the class EPMultipleArtefactsAsTableController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == artefactListTblCtrl) {
        if (event instanceof TableEvent) {
            TableEvent te = (TableEvent) event;
            AbstractArtefact artefact = (AbstractArtefact) artefactListTblCtrl.getTableDataModel().getObject(te.getRowId());
            String action = te.getActionId();
            if (CMD_TITLE.equals(action)) {
                popupArtefact(artefact, ureq);
            } else if (CMD_REFLEXION.equals(action)) {
                EPReflexionWrapperController reflexionCtrl = new EPReflexionWrapperController(ureq, getWindowControl(), secCallback, artefact, struct);
                listenTo(reflexionCtrl);
            } else if (CMD_CHOOSE.equals(action)) {
                fireEvent(ureq, new EPArtefactChoosenEvent(artefact));
            } else if (CMD_UNLINK.equals(action)) {
                struct = ePFMgr.reloadPortfolioStructure(struct);
                ePFMgr.removeArtefactFromStructure(artefact, struct);
                artefactListTblCtrl.modelChanged();
                fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.ADDED, struct));
            } else if (CMD_MOVE.equals(action)) {
                showMoveTree(ureq, artefact);
            } else if (CMD_DELETEARTEFACT.equals(action)) {
                String text = translate("delete.artefact.text", StringHelper.escapeHtml(artefact.getTitle()));
                deleteDialogController = activateYesNoDialog(ureq, translate("delete.artefact"), text, deleteDialogController);
                deleteDialogController.setUserObject(artefact);
            }
        } else if (event instanceof TableMultiSelectEvent) {
            TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
            BitSet objectMarkers = tmse.getSelection();
            List<AbstractArtefact> selectedArtefacts = new ArrayList<>(objectMarkers.size());
            for (int i = objectMarkers.nextSetBit(0); i >= 0; i = objectMarkers.nextSetBit(i + 1)) {
                AbstractArtefact entry = (AbstractArtefact) artefactListTblCtrl.getTableDataModel().getObject(i);
                selectedArtefacts.add(entry);
            }
            fireEvent(ureq, new EPArtefactListChoosenEvent(selectedArtefacts));
        }
    } else if (source == moveTreeCtrl && event.getCommand().equals(EPStructureChangeEvent.CHANGED)) {
        EPStructureChangeEvent epsEv = (EPStructureChangeEvent) event;
        PortfolioStructure newStruct = epsEv.getPortfolioStructure();
        showInfo("artefact.moved", newStruct.getTitle());
        fireEvent(ureq, event);
        moveTreeBox.deactivate();
    } else if (source == deleteDialogController) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            AbstractArtefact artefact2delete = (AbstractArtefact) deleteDialogController.getUserObject();
            ePFMgr.deleteArtefact(artefact2delete);
            ArtefactTableDataModel model = (ArtefactTableDataModel) artefactListTblCtrl.getTableDataModel();
            model.getObjects().remove(artefact2delete);
            artefactListTblCtrl.modelChanged();
            fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.REMOVED, struct));
        }
        removeAsListenerAndDispose(deleteDialogController);
        deleteDialogController = null;
    }
    super.event(ureq, source, event);
}
Also used : TableMultiSelectEvent(org.olat.core.gui.components.table.TableMultiSelectEvent) AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) BitSet(java.util.BitSet) EPReflexionWrapperController(org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController) TableEvent(org.olat.core.gui.components.table.TableEvent) PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) ArrayList(java.util.ArrayList) List(java.util.List) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 9 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.

the class EPArtefactViewOptionsLinkController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == optionLink) {
        popUpArtefactOptionsBox(ureq);
    } else if (source == unlinkLink) {
        closeArtefactOptionsCallout();
        struct = ePFMgr.removeArtefactFromStructure(artefact, struct);
        // refresh ui
        fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.REMOVED, struct));
    } else if (source == moveLink) {
        closeArtefactOptionsCallout();
        showMoveTree(ureq);
    } else if (source == reflexionLink) {
        closeArtefactOptionsCallout();
        reflexionCtrl = new EPReflexionWrapperController(ureq, getWindowControl(), secCallback, artefact, struct);
        listenTo(reflexionCtrl);
    } else if (source == tagsLink) {
        closeArtefactOptionsCallout();
        tagsCtrl = new EPTagsController(ureq, getWindowControl(), secCallback, artefact, struct);
        listenTo(tagsCtrl);
    }
}
Also used : EPTagsController(org.olat.portfolio.ui.artefacts.edit.EPTagsController) EPReflexionWrapperController(org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 10 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.

the class EPArtefactViewOptionsLinkController 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 == moveTreeCtrl && event.getCommand().equals(EPStructureChangeEvent.CHANGED)) {
        EPStructureChangeEvent epsEv = (EPStructureChangeEvent) event;
        PortfolioStructure newStruct = epsEv.getPortfolioStructure();
        showInfo("artefact.moved", newStruct.getTitle());
        moveTreeBox.deactivate();
    } else if (source == artefactOptionCalloutCtrl) {
        removeAsListenerAndDispose(artefactOptionCalloutCtrl);
        artefactOptionCalloutCtrl = null;
    } else if (source == tagsCtrl) {
        if (event == Event.DONE_EVENT) {
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        removeAsListenerAndDispose(tagsCtrl);
    }
    fireEvent(ureq, event);
}
Also used : PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Aggregations

EPStructureChangeEvent (org.olat.portfolio.ui.structel.EPStructureChangeEvent)12 PortfolioStructure (org.olat.portfolio.model.structel.PortfolioStructure)8 AbstractArtefact (org.olat.portfolio.model.artefacts.AbstractArtefact)6 TreeNode (org.olat.core.gui.components.tree.TreeNode)4 EPReflexionWrapperController (org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController)4 ArrayList (java.util.ArrayList)2 BitSet (java.util.BitSet)2 List (java.util.List)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 TreeDropEvent (org.olat.core.gui.components.tree.TreeDropEvent)2 TreeEvent (org.olat.core.gui.components.tree.TreeEvent)2 Event (org.olat.core.gui.control.Event)2 EPAbstractMap (org.olat.portfolio.model.structel.EPAbstractMap)2 EPReflexionChangeEvent (org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent)2 EPTagsController (org.olat.portfolio.ui.artefacts.edit.EPTagsController)2 EPArtefactClicked (org.olat.portfolio.ui.structel.EPArtefactClicked)2