Skip to content

Commit 0b1973e

Browse files
fix ActionUpdateThread.OLD_EDT deprecation on DumbAwareActions
1 parent 424c0c0 commit 0b1973e

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

src/com/magento/idea/magento2plugin/actions/generation/CreateAPluginAction.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package com.magento.idea.magento2plugin.actions.generation;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
9+
import com.intellij.openapi.actionSystem.ActionUpdateThreadAware;
810
import com.intellij.openapi.actionSystem.AnActionEvent;
911
import com.intellij.openapi.actionSystem.PlatformDataKeys;
1012
import com.intellij.openapi.editor.Caret;
@@ -24,7 +26,7 @@
2426
import com.magento.idea.magento2plugin.util.magento.plugin.IsPluginAllowedForMethodUtil;
2527
import org.jetbrains.annotations.NotNull;
2628

27-
public class CreateAPluginAction extends DumbAwareAction {
29+
public class CreateAPluginAction extends DumbAwareAction implements ActionUpdateThreadAware {
2830

2931
public static final String ACTION_NAME = "Create a new Plugin";
3032
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Plugin";
@@ -90,6 +92,11 @@ public boolean isDumbAware() {
9092
return false;
9193
}
9294

95+
@Override
96+
public @NotNull ActionUpdateThread getActionUpdateThread() {
97+
return ActionUpdateThread.BGT;
98+
}
99+
93100
private Pair<PsiFile, PhpClass> findPhpClass(final @NotNull AnActionEvent event) {
94101
final PsiFile psiFile = event.getData(PlatformDataKeys.PSI_FILE);
95102

src/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
package com.magento.idea.magento2plugin.actions.generation;
77

88
import com.intellij.lang.ASTNode;
9+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
10+
import com.intellij.openapi.actionSystem.ActionUpdateThreadAware;
911
import com.intellij.openapi.actionSystem.AnActionEvent;
1012
import com.intellij.openapi.actionSystem.PlatformDataKeys;
1113
import com.intellij.openapi.editor.Caret;
@@ -28,7 +30,7 @@
2830
import com.magento.idea.magento2plugin.project.Settings;
2931
import org.jetbrains.annotations.NotNull;
3032

31-
public class CreateAnObserverAction extends DumbAwareAction {
33+
public class CreateAnObserverAction extends DumbAwareAction implements ActionUpdateThreadAware {
3234

3335
public static final String ACTION_NAME = "Create a new Observer for this event";
3436
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Observer";
@@ -87,6 +89,11 @@ public boolean isDumbAware() {
8789
return false;
8890
}
8991

92+
@Override
93+
public @NotNull ActionUpdateThread getActionUpdateThread() {
94+
return ActionUpdateThread.BGT;
95+
}
96+
9097
private PsiElement getElement(final @NotNull AnActionEvent event) {
9198
final Caret caret = event.getData(PlatformDataKeys.CARET);
9299

src/com/magento/idea/magento2plugin/actions/generation/InjectAViewModelAction.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package com.magento.idea.magento2plugin.actions.generation;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
9+
import com.intellij.openapi.actionSystem.ActionUpdateThreadAware;
810
import com.intellij.openapi.actionSystem.AnActionEvent;
911
import com.intellij.openapi.actionSystem.PlatformDataKeys;
1012
import com.intellij.openapi.editor.Caret;
@@ -21,7 +23,7 @@
2123
import com.magento.idea.magento2plugin.project.Settings;
2224
import org.jetbrains.annotations.NotNull;
2325

24-
public class InjectAViewModelAction extends DumbAwareAction {
26+
public class InjectAViewModelAction extends DumbAwareAction implements ActionUpdateThreadAware {
2527

2628
public static final String ACTION_NAME = "Inject a new View Model for this block";
2729
public static final String ACTION_DESCRIPTION = "Inject a new Magento 2 View Model";
@@ -68,6 +70,11 @@ public boolean isDumbAware() {
6870
return false;
6971
}
7072

73+
@Override
74+
public @NotNull ActionUpdateThread getActionUpdateThread() {
75+
return ActionUpdateThread.BGT;
76+
}
77+
7178
/**
7279
* Get focused (target) element for the event.
7380
*

src/com/magento/idea/magento2plugin/actions/generation/OverrideClassByAPreferenceAction.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package com.magento.idea.magento2plugin.actions.generation;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
9+
import com.intellij.openapi.actionSystem.ActionUpdateThreadAware;
810
import com.intellij.openapi.actionSystem.AnActionEvent;
911
import com.intellij.openapi.actionSystem.PlatformDataKeys;
1012
import com.intellij.openapi.project.DumbAwareAction;
@@ -19,7 +21,7 @@
1921
import com.magento.idea.magento2plugin.util.GetFirstClassOfFile;
2022
import org.jetbrains.annotations.NotNull;
2123

22-
public class OverrideClassByAPreferenceAction extends DumbAwareAction {
24+
public class OverrideClassByAPreferenceAction extends DumbAwareAction implements ActionUpdateThreadAware {
2325
public static final String ACTION_NAME = "Override this class by a new Preference";
2426
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Preference";
2527
public static final String INTERFACE_ACTION = "Override this interface by a new Preference";
@@ -75,6 +77,11 @@ public boolean isDumbAware() {
7577
return false;
7678
}
7779

80+
@Override
81+
public @NotNull ActionUpdateThread getActionUpdateThread() {
82+
return ActionUpdateThread.BGT;
83+
}
84+
7885
private Pair<PsiFile, PhpClass> findPhpClass(@NotNull final AnActionEvent event) {
7986
final PsiFile psiFile = event.getData(PlatformDataKeys.PSI_FILE);
8087

0 commit comments

Comments
 (0)