use of org.olat.core.util.coordinate.LockRemovedEvent in project openolat by klemens.
the class LockController 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)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
LockEntry lockToRelease = locksTableModel.getObject(te.getRowId());
dialogController = activateYesNoDialog(ureq, null, translate("lock.release.sure"), dialogController);
dialogController.setUserObject(lockToRelease);
}
} else if (source == dialogController) {
if (DialogBoxUIFactory.isYesEvent(event)) {
LockEntry lockToRelease = (LockEntry) dialogController.getUserObject();
MultiUserEvent mue = new LockRemovedEvent(lockToRelease);
OLATResourceable lockEntryOres = OresHelper.createOLATResourceableInstance(LockEntry.class, 0l);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(mue, lockEntryOres);
CoordinatorManager.getInstance().getCoordinator().getLocker().releaseLockEntry(lockToRelease);
lockToRelease = null;
resetTableModel();
}
}
}
use of org.olat.core.util.coordinate.LockRemovedEvent in project OpenOLAT by OpenOLAT.
the class LockController 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)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
LockEntry lockToRelease = locksTableModel.getObject(te.getRowId());
dialogController = activateYesNoDialog(ureq, null, translate("lock.release.sure"), dialogController);
dialogController.setUserObject(lockToRelease);
}
} else if (source == dialogController) {
if (DialogBoxUIFactory.isYesEvent(event)) {
LockEntry lockToRelease = (LockEntry) dialogController.getUserObject();
MultiUserEvent mue = new LockRemovedEvent(lockToRelease);
OLATResourceable lockEntryOres = OresHelper.createOLATResourceableInstance(LockEntry.class, 0l);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(mue, lockEntryOres);
CoordinatorManager.getInstance().getCoordinator().getLocker().releaseLockEntry(lockToRelease);
lockToRelease = null;
resetTableModel();
}
}
}
Aggregations