VCS: delete action in unversioned files dialog
authorirengrig <Irina.Chernushina@jetbrains.com>
Wed, 24 Mar 2010 06:53:17 +0000 (09:53 +0300)
committerirengrig <Irina.Chernushina@jetbrains.com>
Wed, 24 Mar 2010 06:53:17 +0000 (09:53 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/DeleteUnversionedFilesAction.java

index de9998327e489e5cae81cd1e1d02cc9e84a006b3..1cd4f44c372208aad0330e15b487da60215be9aa 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.vcs.VcsBundle;
+import com.intellij.openapi.vcs.changes.actions.DeleteUnversionedFilesAction;
 import com.intellij.openapi.vcs.changes.actions.IgnoreUnversionedAction;
 import com.intellij.openapi.vcs.changes.actions.MoveChangesToAnotherListAction;
 import com.intellij.openapi.vcs.changes.actions.ScheduleForAdditionAction;
@@ -132,6 +133,15 @@ public class UnversionedViewDialog extends DialogWrapper {
     myPanel.add(actionToolbar.getComponent(), BorderLayout.WEST);
     myPanel.add(new JScrollPane(myView), BorderLayout.CENTER);
 
+    final DeleteUnversionedFilesAction deleteUnversionedFilesAction = new DeleteUnversionedFilesAction() {
+      @Override
+      public void actionPerformed(AnActionEvent e) {
+        super.actionPerformed(e);
+        refreshView();
+      }
+    };
+    actions.add(deleteUnversionedFilesAction);
+    deleteUnversionedFilesAction.registerCustomShortcutSet(CommonShortcuts.DELETE, myView);
     actions.add(new ScheduleForAdditionAction() {
       @Override
       public void actionPerformed(AnActionEvent e) {
index 3eea449d2182e2ffc50bd30bc18b8b11d2099a9d..44888b2b12ec7e0bbba61b6dbc0acda5f3318662 100644 (file)
@@ -26,8 +26,13 @@ import com.intellij.ide.DeleteProvider;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.util.IconLoader;
 
 public class DeleteUnversionedFilesAction extends AnAction {
+  public DeleteUnversionedFilesAction() {
+    super("Delete", "Delete", IconLoader.getIcon("/actions/cancel.png"));
+  }
+
   public void actionPerformed(AnActionEvent e) {
     DeleteProvider deleteProvider = e.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
     assert deleteProvider != null;