IDEA-81134 'Untracked Files Preventing Checkout': add action to delete files
[idea/community.git] / plugins / git4idea / src / git4idea / util / UntrackedFilesNotifier.java
index 98aaee11fd8fa14cb92e5a12903357ef44e7118a..1ef29d746bab2022f94b530401db3e41365b4891 100644 (file)
@@ -56,13 +56,7 @@ public class UntrackedFilesNotifier {
       public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
         if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
           final String dialogDesc = createUntrackedFilesOverwrittenDescription(operation, false);
-          SelectFilesDialog dlg = new SelectFilesDialog(project, new ArrayList<VirtualFile>(untrackedFiles),
-                                                        StringUtil.stripHtml(dialogDesc, true), null, false, false) {
-            @Override
-            protected Action[] createActions() {
-              return new Action[]{getOKAction()};
-            }
-          };
+          SelectFilesDialog dlg = new UntrackedFilesDialog(project, untrackedFiles, dialogDesc);
           dlg.setTitle("Untracked Files Preventing " + StringUtil.capitalize(operation));
           dlg.show();
         }
@@ -82,4 +76,17 @@ public class UntrackedFilesNotifier {
     }
     return notificationDesc;
   }
+
+  private static class UntrackedFilesDialog extends SelectFilesDialog {
+
+    public UntrackedFilesDialog(Project project, Collection<VirtualFile> untrackedFiles, String dialogDesc) {
+      super(project, new ArrayList<VirtualFile>(untrackedFiles), StringUtil.stripHtml(dialogDesc, true), null, false, false, true);
+    }
+
+    @Override
+    protected Action[] createActions() {
+      return new Action[]{getOKAction()};
+    }
+
+  }
 }