use of org.olat.modules.qpool.ui.events.QItemMarkedEvent in project OpenOLAT by OpenOLAT.
the class AbstractItemListController method event.
@Override
public void event(Event event) {
if (event instanceof QItemMarkedEvent) {
QItemMarkedEvent qime = (QItemMarkedEvent) event;
ItemRow row = getRowByItemKey(qime.getKey());
if (row != null) {
row.setMark(qime.isMark());
}
}
}
use of org.olat.modules.qpool.ui.events.QItemMarkedEvent in project openolat by klemens.
the class QuestionPoolMainEditorController method doDrop.
private void doDrop(UserRequest ureq, String targetId, String dropId) {
try {
int lastIndex = dropId.lastIndexOf('-');
String rowStr = dropId.substring(lastIndex + 1, dropId.length());
int row = Integer.parseInt(rowStr);
QuestionItemShort item = ((QuestionsController) currentCtrl).getQuestionAt(row);
TreeNode node = menuTree.getTreeModel().getNodeById(targetId);
if (node != null) {
Object userObj = node.getUserObject();
if (userObj instanceof BusinessGroup) {
doShareItemsOptions(ureq, singletonList(item), singletonList((BusinessGroup) userObj), null);
} else if (userObj instanceof Pool) {
doShareItemsOptions(ureq, singletonList(item), null, singletonList((Pool) userObj));
} else if (userObj instanceof QuestionItemCollection) {
qpoolService.addItemToCollection(singletonList(item), singletonList((QuestionItemCollection) userObj));
showInfo("item.collectioned", item.getTitle());
} else if (node instanceof MyQuestionsTreeNode) {
doCopyToMyConfirmation(ureq, item);
} else if (node instanceof MarkedQuestionsTreeNode) {
String businessPath = "[QuestionItem:" + item.getKey() + "]";
markManager.setMark(item, getIdentity(), null, businessPath);
QItemMarkedEvent event = new QItemMarkedEvent("marked", item.getKey(), true);
ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(event, QITEM_MARKED);
}
}
} catch (Exception e) {
logError("Cannot drop with id: " + dropId, e);
}
}
use of org.olat.modules.qpool.ui.events.QItemMarkedEvent in project OpenOLAT by OpenOLAT.
the class QuestionPoolMainEditorController method doDrop.
private void doDrop(UserRequest ureq, String targetId, String dropId) {
try {
int lastIndex = dropId.lastIndexOf('-');
String rowStr = dropId.substring(lastIndex + 1, dropId.length());
int row = Integer.parseInt(rowStr);
QuestionItemShort item = ((QuestionsController) currentCtrl).getQuestionAt(row);
TreeNode node = menuTree.getTreeModel().getNodeById(targetId);
if (node != null) {
Object userObj = node.getUserObject();
if (userObj instanceof BusinessGroup) {
doShareItemsOptions(ureq, singletonList(item), singletonList((BusinessGroup) userObj), null);
} else if (userObj instanceof Pool) {
doShareItemsOptions(ureq, singletonList(item), null, singletonList((Pool) userObj));
} else if (userObj instanceof QuestionItemCollection) {
qpoolService.addItemToCollection(singletonList(item), singletonList((QuestionItemCollection) userObj));
showInfo("item.collectioned", item.getTitle());
} else if (node instanceof MyQuestionsTreeNode) {
doCopyToMyConfirmation(ureq, item);
} else if (node instanceof MarkedQuestionsTreeNode) {
String businessPath = "[QuestionItem:" + item.getKey() + "]";
markManager.setMark(item, getIdentity(), null, businessPath);
QItemMarkedEvent event = new QItemMarkedEvent("marked", item.getKey(), true);
ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(event, QITEM_MARKED);
}
}
} catch (Exception e) {
logError("Cannot drop with id: " + dropId, e);
}
}
use of org.olat.modules.qpool.ui.events.QItemMarkedEvent in project openolat by klemens.
the class AbstractItemListController method event.
@Override
public void event(Event event) {
if (event instanceof QItemMarkedEvent) {
QItemMarkedEvent qime = (QItemMarkedEvent) event;
ItemRow row = getRowByItemKey(qime.getKey());
if (row != null) {
row.setMark(qime.isMark());
}
}
}
Aggregations