diff --git a/base/src/com/google/idea/blaze/base/actions/BlazeMenuGroup.java b/base/src/com/google/idea/blaze/base/actions/BlazeMenuGroup.java index a6ec10ce802..14a9f93a5a3 100644 --- a/base/src/com/google/idea/blaze/base/actions/BlazeMenuGroup.java +++ b/base/src/com/google/idea/blaze/base/actions/BlazeMenuGroup.java @@ -26,11 +26,6 @@ /** The "Blaze" menu group, only visible in blaze mode */ public class BlazeMenuGroup extends DefaultActionGroup { - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public final void update(AnActionEvent e) { // Don't hide the menu if project is null: it will be null temporarily while loading a @@ -59,4 +54,9 @@ private static String menuName(BuildSystemName buildSystemName) { public boolean isDumbAware() { return true; } + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } diff --git a/base/src/com/google/idea/blaze/base/actions/BlazeProjectAction.java b/base/src/com/google/idea/blaze/base/actions/BlazeProjectAction.java index 6659fb23595..e3346d8efa3 100644 --- a/base/src/com/google/idea/blaze/base/actions/BlazeProjectAction.java +++ b/base/src/com/google/idea/blaze/base/actions/BlazeProjectAction.java @@ -66,11 +66,6 @@ protected BlazeProjectAction( super(text, description, icon); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public final void update(AnActionEvent e) { Project project = e.getProject(); @@ -132,6 +127,11 @@ public final void actionPerformed(AnActionEvent anActionEvent) { protected void updateForBlazeProject(Project project, AnActionEvent e) {} + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + protected abstract void actionPerformedInBlazeProject(Project project, AnActionEvent e); private boolean compatibleBuildSystem(Project project) { diff --git a/base/src/com/google/idea/blaze/base/actions/BlazeProjectToggleAction.java b/base/src/com/google/idea/blaze/base/actions/BlazeProjectToggleAction.java index fd5be4507d7..a378d6093d3 100644 --- a/base/src/com/google/idea/blaze/base/actions/BlazeProjectToggleAction.java +++ b/base/src/com/google/idea/blaze/base/actions/BlazeProjectToggleAction.java @@ -37,11 +37,6 @@ protected BlazeProjectToggleAction( super(text, description, icon); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public final void update(AnActionEvent e) { Project project = e.getProject(); @@ -56,4 +51,9 @@ public final void update(AnActionEvent e) { } protected void updateForBlazeProject(Project project, AnActionEvent e) {} + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/base/src/com/google/idea/blaze/base/run/exporter/ExportRunConfigurationDialog.java b/base/src/com/google/idea/blaze/base/run/exporter/ExportRunConfigurationDialog.java index 7d21113edc4..f22bbc21d4f 100644 --- a/base/src/com/google/idea/blaze/base/run/exporter/ExportRunConfigurationDialog.java +++ b/base/src/com/google/idea/blaze/base/run/exporter/ExportRunConfigurationDialog.java @@ -259,11 +259,6 @@ private SelectAllButton() { super("Select All", AllIcons.Actions.Selectall); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public synchronized void actionPerformed(AnActionEvent anActionEvent) { boolean newState = !allSelected; @@ -283,5 +278,10 @@ public synchronized void actionPerformed(AnActionEvent anActionEvent) { table.revalidate(); table.repaint(); } + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } } diff --git a/base/src/com/google/idea/blaze/base/sync/actions/IncrementalSyncProjectAction.java b/base/src/com/google/idea/blaze/base/sync/actions/IncrementalSyncProjectAction.java index 0be0dd159c1..b6f86d21f9f 100644 --- a/base/src/com/google/idea/blaze/base/sync/actions/IncrementalSyncProjectAction.java +++ b/base/src/com/google/idea/blaze/base/sync/actions/IncrementalSyncProjectAction.java @@ -28,6 +28,7 @@ import com.intellij.notification.NotificationGroup; import com.intellij.notification.NotificationType; import com.intellij.notification.Notifications; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationNamesInfo; @@ -117,4 +118,10 @@ private static void showPopupNotification(Project project) { protected QuerySyncStatus querySyncSupport() { return QuerySyncStatus.SUPPORTED; } + + @Override + public ActionUpdateThread getActionUpdateThread() { + // Not clear what `showPopupNotification` does and why. + return ActionUpdateThread.EDT; + } } diff --git a/base/src/com/google/idea/blaze/base/toolwindow/ConsoleView.java b/base/src/com/google/idea/blaze/base/toolwindow/ConsoleView.java index 0db33b6081b..19c00acc382 100644 --- a/base/src/com/google/idea/blaze/base/toolwindow/ConsoleView.java +++ b/base/src/com/google/idea/blaze/base/toolwindow/ConsoleView.java @@ -272,13 +272,13 @@ public void actionPerformed(AnActionEvent e) { } @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; + public void update(AnActionEvent event) { + event.getPresentation().setEnabled(stopHandler != null); } @Override - public void update(AnActionEvent event) { - event.getPresentation().setEnabled(stopHandler != null); + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; } } diff --git a/base/src/com/google/idea/blaze/base/ui/problems/BlazeProblemsViewPanel.java b/base/src/com/google/idea/blaze/base/ui/problems/BlazeProblemsViewPanel.java index 0fd981cefb1..a106865f518 100644 --- a/base/src/com/google/idea/blaze/base/ui/problems/BlazeProblemsViewPanel.java +++ b/base/src/com/google/idea/blaze/base/ui/problems/BlazeProblemsViewPanel.java @@ -175,11 +175,6 @@ public AutoscrollToConsoleAction() { super("Autoscroll to console", "Autoscroll to console", AllIcons.Debugger.Console); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public boolean isSelected(AnActionEvent event) { return configuration.getAutoscrollToConsole(); @@ -189,6 +184,11 @@ public boolean isSelected(AnActionEvent event) { public void setSelected(AnActionEvent event, boolean flag) { configuration.setAutoscrollToConsole(flag); } + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } private static class OpenInConsoleAction extends BaseNavigateToSourceAction { @@ -217,11 +217,6 @@ private class ShowWarningsAction extends ToggleAction implements DumbAware { configuration = ErrorTreeViewConfiguration.getInstance(getProject()); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public boolean isSelected(AnActionEvent event) { return !configuration.isHideWarnings(); @@ -234,6 +229,11 @@ public void setSelected(AnActionEvent event, boolean showWarnings) { reload(); } } + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } @Override diff --git a/base/src/com/google/idea/blaze/base/wizard2/BlazeImportProjectAction.java b/base/src/com/google/idea/blaze/base/wizard2/BlazeImportProjectAction.java index 3faf28d575b..4450481e3bc 100644 --- a/base/src/com/google/idea/blaze/base/wizard2/BlazeImportProjectAction.java +++ b/base/src/com/google/idea/blaze/base/wizard2/BlazeImportProjectAction.java @@ -49,11 +49,6 @@ protected ProjectImportWizardStep[] getSteps(WizardContext context) { createFromWizard(projectCreator, wizard.context); } - @Override - public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; - } - @Override public void update(AnActionEvent e) { super.update(e); @@ -61,6 +56,11 @@ public void update(AnActionEvent e) { .setText(String.format("Import %s Project...", Blaze.defaultBuildSystemName())); } + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + private static void createFromWizard( BlazeProjectCreator blazeProjectCreator, WizardContext wizardContext) { try { diff --git a/java/src/com/google/idea/blaze/java/run/hotswap/BlazeHotSwapAction.java b/java/src/com/google/idea/blaze/java/run/hotswap/BlazeHotSwapAction.java index ae4ad5899be..3c24375b4ec 100644 --- a/java/src/com/google/idea/blaze/java/run/hotswap/BlazeHotSwapAction.java +++ b/java/src/com/google/idea/blaze/java/run/hotswap/BlazeHotSwapAction.java @@ -19,6 +19,7 @@ import com.google.idea.common.actions.ReplaceActionHelper; import com.intellij.debugger.actions.HotSwapAction; import com.intellij.openapi.actionSystem.ActionManager; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.impl.ActionConfigurationCustomizer; @@ -60,4 +61,9 @@ public void update(AnActionEvent e) { && BlazeHotSwapManager.findHotSwappableBlazeDebuggerSession(e.getProject()) != null; e.getPresentation().setEnabled(canHotSwap); } + + @Override + public ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } }