help ID for Move File/Directory dialogs (RUBY-5374); cleanup
authorDmitry Jemerov <yole@jetbrains.com>
Fri, 6 Nov 2009 19:46:15 +0000 (22:46 +0300)
committerDmitry Jemerov <yole@jetbrains.com>
Fri, 6 Nov 2009 19:46:15 +0000 (22:46 +0300)
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesDialog.java
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesUtil.java

index bb5dede39a82f5db6aa04ae8f2000349906acac0..8a031f678f9731af112c9d897e0629c7ca5a0d46 100644 (file)
@@ -42,7 +42,7 @@ import java.awt.*;
 import java.io.File;
 
 public class MoveFilesOrDirectoriesDialog extends DialogWrapper{
-  public static interface Callback {
+  public interface Callback {
     void run(MoveFilesOrDirectoriesDialog dialog);
   }
 
@@ -152,6 +152,7 @@ public class MoveFilesOrDirectoriesDialog extends DialogWrapper{
               myTargetDirectory = DirectoryUtil.mkdirs(PsiManager.getInstance(myProject), directoryName);
             }
             catch (IncorrectOperationException e) {
+              // ignore
             }
           }
         };
index abd7e6ae2b2728d7f76cce6e7171f65801c49dac..1487805e7fdd41f02d8318efcaa800f45f8fca80 100644 (file)
@@ -66,7 +66,7 @@ public class MoveFilesOrDirectoriesUtil {
     }
 
     final PsiDirectory targetDirectory = resolveToDirectory(project, targetElement[0]);
-    if (targetElement != null && targetElement[0] != null && targetDirectory == null) return;
+    if (targetElement[0] != null && targetDirectory == null) return;
 
     final PsiDirectory initialTargetDirectory = getInitialTargetDirectory(targetDirectory, elements);
 
@@ -92,19 +92,19 @@ public class MoveFilesOrDirectoriesUtil {
         }
         catch (IncorrectOperationException e) {
           CommonRefactoringUtil.showErrorMessage(RefactoringBundle.message("error.title"), e.getMessage(),
-                                                 "refactoring.movePackage", project);
+                                                 "refactoring.moveFile", project);
         }
       }
     };
 
     final MoveFilesOrDirectoriesDialog moveDialog = new MoveFilesOrDirectoriesDialog(project, doRun);
-    moveDialog.setData(elements, initialTargetDirectory, "refactoring.movePackage");
+    moveDialog.setData(elements, initialTargetDirectory, "refactoring.moveFile");
     moveDialog.show();
   }
 
   @Nullable
   private static PsiDirectory resolveToDirectory(final Project project, final PsiElement element) {
-    if (!(element instanceof PsiDirectoryContainer)) {
+    if (!(element instanceof PsiDirectoryContainer)) {                                                                 
       return (PsiDirectory)element;
     }