}
// get the Parent node and delete all children nodes (only that we know of)
String parentNodePath = spre.getParentTreeNodePath();
List<String> childNodeNames = spre.getChildTreeNodeNames();
TreeNode rootNode = mrdr.get(instanceName);
if ((rootNode != null) && (parentNodePath != null)) {
// This has to return one node
List<TreeNode> nodeList = rootNode.getNodes(parentNodePath, false, true);
if (nodeList.size() > 0) {
TreeNode parentNode = nodeList.get(0);
//Remove each of the child nodes
Collection<TreeNode> childNodes = parentNode.getChildNodes();
for (TreeNode childNode : childNodes) {
if (childNodeNames.contains(childNode.getName())) {
parentNode.removeChild(childNode);
}
}
if (!parentNode.hasChildNodes())
removeParentNode(parentNode);
}
}
//get the handles and unregister the listeners from Flashlight