some action groups made dumb-aware
authorKirill Kalishev <kirill.kalishev@jetbrains.com>
Fri, 16 Jul 2010 09:50:04 +0000 (13:50 +0400)
committerKirill Kalishev <kirill.kalishev@jetbrains.com>
Fri, 16 Jul 2010 09:50:04 +0000 (13:50 +0400)
26 files changed:
java/debugger/impl/src/com/intellij/debugger/actions/ViewAsGroup.java
java/debugger/impl/src/com/intellij/debugger/ui/DebuggerSessionTab.java
java/idea-ui/src/com/intellij/facet/impl/ui/actions/AddFacetActionGroup.java
platform/lang-impl/src/com/intellij/codeInsight/completion/actions/CodeCompletionGroup.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/actions/FoldingActionGroup.java
platform/lang-impl/src/com/intellij/execution/actions/BaseRunConfigurationAction.java
platform/lang-impl/src/com/intellij/ide/actions/ExcludingActionGroup.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/actions/CreateFromTemplateGroup.java
platform/lang-impl/src/com/intellij/tools/ExternalToolsGroup.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryGroup.java
platform/platform-api/src/com/intellij/openapi/actionSystem/ActionGroup.java
platform/platform-api/src/com/intellij/ui/switcher/QuickActionManager.java
platform/platform-impl/src/com/intellij/ide/actions/CodeEditorActionGroup.java
platform/platform-impl/src/com/intellij/ide/actions/OtherGroup.java
platform/platform-impl/src/com/intellij/ide/actions/RecentProjectsGroup.java
platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationUtil.java
platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java
platform/vcs-api/src/com/intellij/openapi/vcs/actions/StandardVcsGroup.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsActionGroup.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsGroupsWrapper.java
platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/CheckoutActionGroup.java
plugins/ant/src/com/intellij/lang/ant/config/actions/AntBuildGroup.java
plugins/commander/src/com/intellij/ide/actions/CommanderViewActionGroup.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/DownloadActionGroup.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/actions/MavenActionGroup.java
plugins/svn4idea/src/org/jetbrains/idea/svn/actions/IgnoreActionGroup.java

index 6dfe16463e06519c804f82b070b3568adeaed945..088ec13e8fadc1956377ae7a86154edf1e8ddfec 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl;
 import com.intellij.debugger.ui.tree.render.NodeRenderer;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
@@ -34,7 +35,7 @@ import java.util.List;
  * Date: Sep 26, 2003
  * Time: 11:05:57 PM
  */
-public class ViewAsGroup extends ActionGroup{
+public class ViewAsGroup extends ActionGroup implements DumbAware {
   private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.actions.ViewAsGroup");
 
   private AnAction[] myChildren = AnAction.EMPTY_ARRAY;
index 4a71d7f56ebd8e3906cda56a08e1fc79239cf349..9476c8f925626e136f3f8179bbe3ceb3ab68041e 100644 (file)
@@ -338,6 +338,11 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
         e.getPresentation().setText(ActionsBundle.message("group.XDebugger.settings.text"));
         e.getPresentation().setIcon(layoutGroup.getTemplatePresentation().getIcon());
       }
+
+      @Override
+      public boolean isDumbAware() {
+        return true;
+      }
     };
     for (AnAction each : layout) {
       settings.add(each);
index beb3b85073e540a2d8eba45da746a52d6957bc4b..0624e929c04516d78314a8344f07f360265a28f7 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.facet.FacetTypeRegistry;
 import com.intellij.openapi.actionSystem.ActionGroup;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.DumbAware;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Arrays;
@@ -30,7 +31,7 @@ import java.util.Comparator;
 /**
  * @author nik
 */
-public class AddFacetActionGroup extends ActionGroup {
+public class AddFacetActionGroup extends ActionGroup implements DumbAware {
   private final boolean myFromPopup;
   private final FacetEditorFacade myEditor;
   private AnAction[] myCachedChildren;
index dfdf98c073c9eb2b721f69224c712e6a31814b9e..b4be2de99a73cf50b0275ea439327a729bbe4dd7 100644 (file)
@@ -18,11 +18,12 @@ package com.intellij.codeInsight.completion.actions;
 
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 
-public class CodeCompletionGroup extends DefaultActionGroup {
+public class CodeCompletionGroup extends DefaultActionGroup implements DumbAware {
 
   public void update(AnActionEvent event){
     Presentation presentation = event.getPresentation();
index d1fbde6e47aca66ff65d5d62853f2c5b72bc3eb6..1a139fcb1870b20d261222b50235154ac72915e5 100644 (file)
@@ -19,8 +19,9 @@ package com.intellij.codeInsight.folding.impl.actions;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.ex.FoldingModelEx;
+import com.intellij.openapi.project.DumbAware;
 
-public class FoldingActionGroup extends DefaultActionGroup {
+public class FoldingActionGroup extends DefaultActionGroup  implements DumbAware {
   public FoldingActionGroup() {
     super();
   }
index 62afe1947d0bef65a7e4db5c5f2c0ade6eab3d87..564fa8d0a01d19c1d4c92e0f986e2d4ae685ed7c 100644 (file)
@@ -178,12 +178,7 @@ public abstract class BaseRunConfigurationAction extends ActionGroup {
     final RunnerAndConfigurationSettings existing = context.findExisting();
     RunnerAndConfigurationSettings configuration = existing;
     if (configuration == null) {
-      try {
-        configuration = context.getConfiguration();
-      }
-      catch (IndexNotReadyException e) {
-        configuration = null;
-      }
+      configuration = context.getConfiguration();
     }
     if (configuration == null){
       presentation.setEnabled(false);
index 5d3738a00dd2ba7074289796d81e346b1ccbf529..27e74a2200ffa84f8c614419536f5e20ea027206 100644 (file)
@@ -43,6 +43,11 @@ public class ExcludingActionGroup extends ActionGroup {
     myDelegate.update(e);
   }
 
+  @Override
+  public boolean isDumbAware() {
+    return myDelegate.isDumbAware();
+  }
+
   @NotNull
   public AnAction[] getChildren(@Nullable AnActionEvent e) {
     List<AnAction> result = new ArrayList<AnAction>();
index 0611e9e2f5a73614d885f10a814d41cd409e201b..f86adaef882173eb8e34460aff302f7005933f94 100644 (file)
@@ -27,13 +27,14 @@ import com.intellij.ide.fileTemplates.ui.SelectTemplateDialog;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.PsiDirectory;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
 
-public class CreateFromTemplateGroup extends ActionGroup{
+public class CreateFromTemplateGroup extends ActionGroup implements DumbAware {
   private static final Logger LOG = Logger.getInstance("#com.intellij.ide.fileTemplates.actions.CreateFromTemplateGroup");
 
   public void update(AnActionEvent event){
index ca06b28a74d06c5e774380b2ec073a7ebb01cfcc..791c46fcc6fcc9d58b91f97a78117554f7b9edee 100644 (file)
 package com.intellij.tools;
 
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 
 /**
  * @author Eugene Belyaev
  */
-public class ExternalToolsGroup extends SimpleActionGroup {
+public class ExternalToolsGroup extends SimpleActionGroup implements DumbAware {
   public void update(AnActionEvent event){
     Presentation presentation = event.getPresentation();
     removeAll();
index 3af9f4b2c54450db4abafbf53a37dea1136478e9..8e67d2372493924feb894c28bc948f2767dc607d 100644 (file)
@@ -20,8 +20,9 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 
-public class LocalHistoryGroup extends DefaultActionGroup {
+public class LocalHistoryGroup extends DefaultActionGroup implements DumbAware {
   public void update(AnActionEvent event) {
     Presentation p = event.getPresentation();
     boolean hasProject = event.getData(PlatformDataKeys.PROJECT) != null;
index 18acf3f0cf68b7c12217cd159e849f055b469d7f..b2946b38272c24c6cef7fea585a9c2a47bc5d202 100644 (file)
@@ -82,6 +82,11 @@ public abstract class ActionGroup extends AnAction {
   public void actionPerformed(AnActionEvent e){
   }
 
+  @Override
+  public void update(AnActionEvent e) {
+    super.update(e);
+  }
+
   /**
    * @return true if {@link #actionPerformed(AnActionEvent)} should be called
    */
index ee57aa1a846e6843ab4d266c8b32a8f2f83b34c9..d61036cca13919e1deac5099700182768ecf484b 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.components.ProjectComponent;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
 import com.intellij.openapi.util.AsyncResult;
@@ -105,7 +106,7 @@ public class QuickActionManager implements ProjectComponent {
 
   }
 
-  private class Group extends DefaultActionGroup {
+  private class Group extends DefaultActionGroup implements DumbAware {
     private String myTitle;
 
     private Group(List<AnAction> actions, String title) {
index 55cd49780758865033177ceb7fb200c49383da76..43597f77ac2461ac42b7fb4a3b93543517341a27 100644 (file)
@@ -19,10 +19,11 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.wm.ToolWindowManager;
 
-public class CodeEditorActionGroup extends DefaultActionGroup {
+public class CodeEditorActionGroup extends DefaultActionGroup implements DumbAware {
   public CodeEditorActionGroup() {
     super();
   }
index c5cd0b328429c550a4536d663130eb66d5c24ab3..79307c73fadd8b8c8ad30ed61e9f7275303ebd3c 100644 (file)
@@ -18,8 +18,9 @@ package com.intellij.ide.actions;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 
-public class OtherGroup extends DefaultActionGroup {
+public class OtherGroup extends DefaultActionGroup implements DumbAware {
   public OtherGroup() {
     super();
   }
index 1ed87056ec1486b76227e5345bf11454f2f0b67c..3d1a8c14574db73742c73bacd47e3518c142def4 100644 (file)
@@ -21,11 +21,12 @@ import com.intellij.openapi.actionSystem.ActionGroup;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.SystemInfo;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-public class RecentProjectsGroup extends ActionGroup {
+public class RecentProjectsGroup extends ActionGroup implements DumbAware {
   public RecentProjectsGroup() {
     super();
 
index 775faa3907d5956931f3d32c7324c6cd31946704..9f9df41e6641052158cdf09a36b4a55ad39898c7 100644 (file)
@@ -138,6 +138,11 @@ public class CustomizationUtil {
     public void update(AnActionEvent e) {
       myGroup.update(e);
     }
+
+    @Override
+    public boolean isDumbAware() {
+      return myGroup.isDumbAware();
+    }
   }
 
   public static void optimizeSchema(final JTree tree, final CustomActionsSchema schema) {
index d6b6903e98c21dcaa53ecf4c4c60084046141744..aa90f23f59f6daa2d4d38dd55c47aeac0e73cab0 100644 (file)
@@ -329,6 +329,11 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
         super.update(e);
         myButtonPanel.update();
       }
+
+      @Override
+      public boolean isDumbAware() {
+        return true;
+      }
     };
 
     AnAction[] actions = createActions();
index a7858e33eaf2242eaf2ff1fecedf795c1fe291dc..c8c03bcfaff9100b30edd390fc118c829900cb46 100644 (file)
@@ -19,13 +19,14 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vcs.AbstractVcs;
 import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 
-public abstract class StandardVcsGroup extends DefaultActionGroup {
+public abstract class StandardVcsGroup extends DefaultActionGroup implements DumbAware {
   public abstract AbstractVcs getVcs(Project project);
 
   public void update(AnActionEvent e) {
index 9be256cf12d2de2f05e742e9bfbaf49e9a2e6f36..57473b17361d10f7487e7d5a940a24bca191b176 100644 (file)
@@ -19,12 +19,13 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 
 /**
  * @author mike
  */
-public class VcsActionGroup extends DefaultActionGroup {
+public class VcsActionGroup extends DefaultActionGroup implements DumbAware {
   public void update(AnActionEvent event) {
     super.update(event);
 
index acdee8ce201792ac4c4795819d34545697cbbecb..588f483d412d1e0be9d1a7c9fd5c1ad3f675751b 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.openapi.vcs.actions;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.actionSystem.impl.PresentationFactory;
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vcs.AbstractVcs;
 import com.intellij.openapi.vcs.ProjectLevelVcsManager;
@@ -26,7 +27,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 
 import java.util.*;
 
-public class VcsGroupsWrapper extends DefaultActionGroup {
+public class VcsGroupsWrapper extends DefaultActionGroup implements DumbAware {
 
   private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.actions.DefaultActionGroup");
 
index 2f7cb134c2fccb2f4b4ec02c5c976ba15f735f71..cd043d408b286c6c706d73d4fb0cdee92d7d68c9 100644 (file)
@@ -19,13 +19,14 @@ import com.intellij.openapi.actionSystem.ActionGroup;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.extensions.Extensions;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.vcs.CheckoutProvider;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Arrays;
 import java.util.Comparator;
 
-public class CheckoutActionGroup extends ActionGroup {
+public class CheckoutActionGroup extends ActionGroup implements DumbAware {
 
   private AnAction[] myChildren;
 
index 6ed6ba7be96bf0390f4726999704e2c0ac28ead2..82f31080c2d25a36cfb2263b7dd187f0051a91e4 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.lang.ant.config.actions;
 import com.intellij.lang.ant.config.*;
 import com.intellij.lang.ant.config.impl.MetaTarget;
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.util.StringSetSpinAllocator;
 import org.jetbrains.annotations.Nullable;
@@ -26,7 +27,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
-public final class AntBuildGroup extends ActionGroup {
+public final class AntBuildGroup extends ActionGroup implements DumbAware {
 
   public void update(AnActionEvent event) {
     Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext());
index 16956d85f9b979616b39a5011a7efe04fb273cb4..3d3af0ef4c937f06be2c621003a53e6a30fde974 100644 (file)
@@ -19,11 +19,12 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.wm.ToolWindowId;
 import com.intellij.openapi.wm.ToolWindowManager;
 
-public class CommanderViewActionGroup extends DefaultActionGroup {
+public class CommanderViewActionGroup extends DefaultActionGroup  implements DumbAware {
   public CommanderViewActionGroup() {
     super();
   }
index 2c206cb37b037069b5456205276294c895af0ea7..bb9d0b2a0447778339ea4165556e600a2d4bcf8e 100644 (file)
@@ -18,9 +18,10 @@ package org.jetbrains.idea.maven.project.actions;
 import com.intellij.openapi.actionSystem.ActionGroup;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.project.DumbAware;
 import org.jetbrains.idea.maven.utils.actions.MavenActionUtil;
 
-public class DownloadActionGroup extends DefaultActionGroup {
+public class DownloadActionGroup extends DefaultActionGroup implements DumbAware {
   @Override
   public void update(AnActionEvent e) {
     super.update(e);
index c5e96bfc0203abef7a6470bf4cc46129271454f6..2d3c60fd0b6f31e88cbc08f2b3e36e93f8ad2922 100644 (file)
@@ -18,8 +18,9 @@ package org.jetbrains.idea.maven.utils.actions;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.openapi.project.DumbAware;
 
-public class MavenActionGroup extends DefaultActionGroup {
+public class MavenActionGroup extends DefaultActionGroup implements DumbAware {
   @Override
   public void update(AnActionEvent e) {
     super.update(e);
index e449c075dc42b7be9249ea83c1e763d99552dadf..b3d672cc648da063bfae582fbb82b35211e9ff1c 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Ref;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -32,7 +33,7 @@ import org.jetbrains.idea.svn.ignore.SvnPropertyService;
 import java.util.Map;
 import java.util.Set;
 
-public class IgnoreActionGroup extends DefaultActionGroup {
+public class IgnoreActionGroup extends DefaultActionGroup implements DumbAware {
   private final IgnoreGroupHelperAction myHelperAction;
   private final IgnoreInfoGetterStub myGetterStub;