use of org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController in project OpenOLAT by OpenOLAT.
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);
}
use of org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController 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);
}
}
use of org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController 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);
}
use of org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController 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);
}
}
Aggregations