From b1835c394e354eae01c51fb1feb2aa7053e1aba9 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 5 Apr 2011 11:30:39 +0400 Subject: [PATCH] GitInit, HgInit : update() does nothing, removed. --- .../src/git4idea/actions/GitInit.java | 23 +------------------ .../src/org/zmlx/hg4idea/action/HgInit.java | 11 --------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/plugins/git4idea/src/git4idea/actions/GitInit.java b/plugins/git4idea/src/git4idea/actions/GitInit.java index 4f95f484384c..b234fb22d740 100644 --- a/plugins/git4idea/src/git4idea/actions/GitInit.java +++ b/plugins/git4idea/src/git4idea/actions/GitInit.java @@ -17,7 +17,6 @@ package git4idea.actions; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.fileChooser.FileChooser; import com.intellij.openapi.fileChooser.FileChooserDescriptor; import com.intellij.openapi.progress.ProgressIndicator; @@ -47,9 +46,7 @@ import java.util.List; * Initialize git repository action */ public class GitInit extends DumbAwareAction { - /** - * {@inheritDoc} - */ + public void actionPerformed(final AnActionEvent e) { Project project = e.getData(PlatformDataKeys.PROJECT); if (project == null) { @@ -126,22 +123,4 @@ public class GitInit extends DumbAwareAction { GitUtil.refreshFiles(project, Collections.singleton(root)); } - /** - * {@inheritDoc} - */ - @Override - public void update(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); - if (project == null) { - project = ProjectManager.getInstance().getDefaultProject(); - } - Presentation presentation = e.getPresentation(); - if (project == null) { - presentation.setEnabled(false); - presentation.setVisible(false); - return; - } - presentation.setEnabled(true); - presentation.setVisible(true); - } } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgInit.java b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgInit.java index b34171f35b8a..de16ba14e30f 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgInit.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgInit.java @@ -103,17 +103,6 @@ public class HgInit extends DumbAwareAction { } } - @Override - public void update(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); - if (project == null) { - project = ProjectManager.getInstance().getDefaultProject(); - } - final Presentation presentation = e.getPresentation(); - presentation.setEnabled(project != null); - presentation.setVisible(project != null); - } - private boolean createRepository(VirtualFile selectedRoot) { final boolean succeeded = (new HgInitCommand(myProject)).execute(selectedRoot); Notifications.Bus.notify(new Notification(HgVcs.NOTIFICATION_GROUP_ID,