File tree 4 files changed +35
-5
lines changed
src/com/magento/idea/magento2plugin/actions/generation
4 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 5
5
6
6
package com .magento .idea .magento2plugin .actions .generation ;
7
7
8
+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9
+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
8
10
import com .intellij .openapi .actionSystem .AnActionEvent ;
9
11
import com .intellij .openapi .actionSystem .PlatformDataKeys ;
10
12
import com .intellij .openapi .editor .Caret ;
24
26
import com .magento .idea .magento2plugin .util .magento .plugin .IsPluginAllowedForMethodUtil ;
25
27
import org .jetbrains .annotations .NotNull ;
26
28
27
- public class CreateAPluginAction extends DumbAwareAction {
29
+ public class CreateAPluginAction extends DumbAwareAction implements ActionUpdateThreadAware {
28
30
29
31
public static final String ACTION_NAME = "Create a new Plugin" ;
30
32
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Plugin" ;
@@ -90,6 +92,11 @@ public boolean isDumbAware() {
90
92
return false ;
91
93
}
92
94
95
+ @ Override
96
+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
97
+ return ActionUpdateThread .BGT ;
98
+ }
99
+
93
100
private Pair <PsiFile , PhpClass > findPhpClass (final @ NotNull AnActionEvent event ) {
94
101
final PsiFile psiFile = event .getData (PlatformDataKeys .PSI_FILE );
95
102
Original file line number Diff line number Diff line change 6
6
package com .magento .idea .magento2plugin .actions .generation ;
7
7
8
8
import com .intellij .lang .ASTNode ;
9
+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
10
+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
9
11
import com .intellij .openapi .actionSystem .AnActionEvent ;
10
12
import com .intellij .openapi .actionSystem .PlatformDataKeys ;
11
13
import com .intellij .openapi .editor .Caret ;
28
30
import com .magento .idea .magento2plugin .project .Settings ;
29
31
import org .jetbrains .annotations .NotNull ;
30
32
31
- public class CreateAnObserverAction extends DumbAwareAction {
33
+ public class CreateAnObserverAction extends DumbAwareAction
34
+ implements ActionUpdateThreadAware {
32
35
33
36
public static final String ACTION_NAME = "Create a new Observer for this event" ;
34
37
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Observer" ;
@@ -87,6 +90,11 @@ public boolean isDumbAware() {
87
90
return false ;
88
91
}
89
92
93
+ @ Override
94
+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
95
+ return ActionUpdateThread .BGT ;
96
+ }
97
+
90
98
private PsiElement getElement (final @ NotNull AnActionEvent event ) {
91
99
final Caret caret = event .getData (PlatformDataKeys .CARET );
92
100
Original file line number Diff line number Diff line change 5
5
6
6
package com .magento .idea .magento2plugin .actions .generation ;
7
7
8
+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9
+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
8
10
import com .intellij .openapi .actionSystem .AnActionEvent ;
9
11
import com .intellij .openapi .actionSystem .PlatformDataKeys ;
10
12
import com .intellij .openapi .editor .Caret ;
21
23
import com .magento .idea .magento2plugin .project .Settings ;
22
24
import org .jetbrains .annotations .NotNull ;
23
25
24
- public class InjectAViewModelAction extends DumbAwareAction {
26
+ public class InjectAViewModelAction extends DumbAwareAction implements ActionUpdateThreadAware {
25
27
26
28
public static final String ACTION_NAME = "Inject a new View Model for this block" ;
27
29
public static final String ACTION_DESCRIPTION = "Inject a new Magento 2 View Model" ;
@@ -68,6 +70,11 @@ public boolean isDumbAware() {
68
70
return false ;
69
71
}
70
72
73
+ @ Override
74
+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
75
+ return ActionUpdateThread .BGT ;
76
+ }
77
+
71
78
/**
72
79
* Get focused (target) element for the event.
73
80
*
@@ -98,7 +105,7 @@ private XmlTag getElement(final @NotNull AnActionEvent event) {
98
105
if (xmlTag == null ) {
99
106
return null ;
100
107
}
101
- XmlTag resultTag ;
108
+ final XmlTag resultTag ;
102
109
103
110
if (CommonXml .ATTRIBUTE_ARGUMENTS .equals (xmlTag .getName ())) {
104
111
resultTag = PsiTreeUtil .getParentOfType (xmlTag , XmlTag .class );
Original file line number Diff line number Diff line change 5
5
6
6
package com .magento .idea .magento2plugin .actions .generation ;
7
7
8
+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9
+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
8
10
import com .intellij .openapi .actionSystem .AnActionEvent ;
9
11
import com .intellij .openapi .actionSystem .PlatformDataKeys ;
10
12
import com .intellij .openapi .project .DumbAwareAction ;
19
21
import com .magento .idea .magento2plugin .util .GetFirstClassOfFile ;
20
22
import org .jetbrains .annotations .NotNull ;
21
23
22
- public class OverrideClassByAPreferenceAction extends DumbAwareAction {
24
+ public class OverrideClassByAPreferenceAction extends DumbAwareAction
25
+ implements ActionUpdateThreadAware {
23
26
public static final String ACTION_NAME = "Override this class by a new Preference" ;
24
27
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Preference" ;
25
28
public static final String INTERFACE_ACTION = "Override this interface by a new Preference" ;
@@ -75,6 +78,11 @@ public boolean isDumbAware() {
75
78
return false ;
76
79
}
77
80
81
+ @ Override
82
+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
83
+ return ActionUpdateThread .BGT ;
84
+ }
85
+
78
86
private Pair <PsiFile , PhpClass > findPhpClass (@ NotNull final AnActionEvent event ) {
79
87
final PsiFile psiFile = event .getData (PlatformDataKeys .PSI_FILE );
80
88
You can’t perform that action at this time.
0 commit comments