public void useLibraryFragment() {
if ((selectedLibNode == null) || (selectedReqNode == null)) {
log.debug("use template is not possible, select first a criterion/requirement of the library, and a requirement in Your tree.");
return;
}
TreeNode node = null;
if (selectedReqNode.isLeaf()) {
node = selectedReqNode.getParent();
((Node)node).removeChild(selectedReqNode);
nodesToDelete.add(selectedReqNode);
selectedReqNode = node;
} else {
node = selectedReqNode;
}
if (node != null) {
// append tree fragment
TreeNode clone = selectedLibNode.clone();
((Node)node).addChild(clone);
treeHelper.expand(clone);
}
}