public void onNodeMoved(
PathUtil oldPath, FileTreeNode node, PathUtil newPath, FileTreeNode newNode) {
// if the moved node is currently open in the editor, or is a dir that is
// somewhere in the path of whatever is open in the editor, then fix the
// breadcrumbs
PathUtil editorPath = editorBundle.getBreadcrumbs().getPath();
if (editorPath == null) {
return;
}
if (oldPath.containsPath(editorPath)) {
// replace the start of the editor's path with the node's new path
final PathUtil newEditorPath = PathUtil.concatenate(newPath,
PathUtil.createExcludingFirstN(editorPath, oldPath.getPathComponentsCount()));
editorBundle.getBreadcrumbs().setPath(newEditorPath);
// Wait until DocumentManagerFileTreeModelListener updates the path in the document.