showInvalidRenameMessage("Rename.Invalid_Parent");
} else {
try {
// try performing the renaming operation.
HierarchyAlterer hierarchyAlterer = DashController
.getHierarchyAlterer();
hierarchyAlterer.renameNode(projectPath, newPath);
// if this caused the old parent of the project to become
// childless, delete that parent (and grandparent, etc)
PropertyKey oldParent = projectNode.getParent();
while (ctx.getHierarchy().getNumChildren(oldParent) == 0) {
hierarchyAlterer.deleteNode(oldParent.path());
oldParent = oldParent.getParent();
}
// point the "active task" at the renamed project.
PropertyKey newNode = ctx.getHierarchy().findExistingKey(