parentTargetNode.insert(newNode, targetPos);
// insert into model
parentTargetNode.insertQTIObjectAt(qtiItem, targetPos);
// activate copied node
menuTree.setSelectedNodeId(newNode.getIdent());
event(ureq, menuTree, new Event(MenuTree.COMMAND_TREENODE_CLICKED));
qtiPackage.serializeQTIDocument();
}
} else if (source == insertTree) { // catch insert operations
cmc.deactivate();
removeAsListenerAndDispose(cmc);
cmc = null;
TreeEvent te = (TreeEvent) event;
if (te.getCommand().equals(TreeEvent.COMMAND_TREENODE_CLICKED)) { // insert
// new
// node
String nodeId = te.getNodeId();
TreePosition tp = insertTreeModel.getTreePosition(nodeId);
GenericQtiNode parentTargetNode = (GenericQtiNode) tp.getParentTreeNode();
// insert into menu tree
parentTargetNode.insert(insertObject, tp.getChildpos());
// insert into model
parentTargetNode.insertQTIObjectAt(insertObject.getUnderlyingQTIObject(), tp.getChildpos());
// activate inserted node
menuTree.setSelectedNodeId(insertObject.getIdent());
event(ureq, menuTree, new Event(MenuTree.COMMAND_TREENODE_CLICKED));
qtiPackage.serializeQTIDocument();
}
} else if (source == exitVC) {
if (event.getCommand().equals(CMD_EXIT_SAVE)) {
if (isRestrictedEdit() && history.size() > 0) {