}
break;
case CUT:
// You can't paste the selection into one of the directory you are cutting.
boolean isCurrentDirectoryInSelection = false;
DirectoryTreeNode currentDirectoryTreeNode = new DirectoryTreeNode(
currentDirectory);
for (ATreeNode treeNode : copyCutSelection) {
if (currentDirectoryTreeNode.equals(treeNode)
|| isChild(currentDirectoryTreeNode, treeNode)) {
isCurrentDirectoryInSelection = true;
break;
}
}
if (!isCurrentDirectoryInSelection) {
for (ATreeNode treeNode : copyCutSelection) {
if (treeNode instanceof ConfigTreeNode) {
cutPasteConfig((ConfigTreeNode) treeNode);
}
else {
cutPasteDirectory((DirectoryTreeNode) treeNode);
}
}
}
}
// Expand the current directory if it was not already.
refresh();
view.expandNode(new DirectoryTreeNode(currentDirectory));
}
}