refactor Create Package to make sure undo works correctly (PY-1829)
authorDmitry Jemerov <yole@jetbrains.com>
Wed, 15 Sep 2010 13:40:35 +0000 (17:40 +0400)
committerDmitry Jemerov <yole@jetbrains.com>
Wed, 15 Sep 2010 18:11:56 +0000 (22:11 +0400)
platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageHandler.java

index f820d62bcc6eda784f4bd3fa7bf72b096801cedd..2c3b2dadf4a481df5effa509325bbb05e13681d7 100644 (file)
@@ -93,7 +93,7 @@ public class CreateDirectoryOrPackageHandler implements InputValidatorEx {
               actionName = IdeBundle.message("progress.creating.directory", dirPath, File.separator, subDirName);
               action = LocalHistory.getInstance().startAction(actionName);
 
-              myCreatedElement = DirectoryUtil.createSubdirectories(subDirName, myDirectory, myDelimiters);
+              createDirectories(subDirName);
 
             }
             catch (final IncorrectOperationException ex) {
@@ -119,6 +119,10 @@ public class CreateDirectoryOrPackageHandler implements InputValidatorEx {
     return myCreatedElement != null;
   }
 
+  protected void createDirectories(String subDirName) {
+    myCreatedElement = DirectoryUtil.createSubdirectories(subDirName, myDirectory, myDelimiters);
+  }
+
   public PsiDirectory getCreatedElement() {
     return myCreatedElement;
   }