File tree Expand file tree Collapse file tree 4 files changed +35
-5
lines changed
src/com/magento/idea/magento2plugin/actions/generation Expand file tree Collapse file tree 4 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 55
66package com .magento .idea .magento2plugin .actions .generation ;
77
8+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
810import com .intellij .openapi .actionSystem .AnActionEvent ;
911import com .intellij .openapi .actionSystem .PlatformDataKeys ;
1012import com .intellij .openapi .editor .Caret ;
2426import com .magento .idea .magento2plugin .util .magento .plugin .IsPluginAllowedForMethodUtil ;
2527import 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
Original file line number Diff line number Diff line change 66package com .magento .idea .magento2plugin .actions .generation ;
77
88import com .intellij .lang .ASTNode ;
9+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
10+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
911import com .intellij .openapi .actionSystem .AnActionEvent ;
1012import com .intellij .openapi .actionSystem .PlatformDataKeys ;
1113import com .intellij .openapi .editor .Caret ;
2830import com .magento .idea .magento2plugin .project .Settings ;
2931import org .jetbrains .annotations .NotNull ;
3032
31- public class CreateAnObserverAction extends DumbAwareAction {
33+ public class CreateAnObserverAction extends DumbAwareAction
34+ implements ActionUpdateThreadAware {
3235
3336 public static final String ACTION_NAME = "Create a new Observer for this event" ;
3437 public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Observer" ;
@@ -87,6 +90,11 @@ public boolean isDumbAware() {
8790 return false ;
8891 }
8992
93+ @ Override
94+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
95+ return ActionUpdateThread .BGT ;
96+ }
97+
9098 private PsiElement getElement (final @ NotNull AnActionEvent event ) {
9199 final Caret caret = event .getData (PlatformDataKeys .CARET );
92100
Original file line number Diff line number Diff line change 55
66package com .magento .idea .magento2plugin .actions .generation ;
77
8+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
810import com .intellij .openapi .actionSystem .AnActionEvent ;
911import com .intellij .openapi .actionSystem .PlatformDataKeys ;
1012import com .intellij .openapi .editor .Caret ;
2123import com .magento .idea .magento2plugin .project .Settings ;
2224import 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 *
@@ -98,7 +105,7 @@ private XmlTag getElement(final @NotNull AnActionEvent event) {
98105 if (xmlTag == null ) {
99106 return null ;
100107 }
101- XmlTag resultTag ;
108+ final XmlTag resultTag ;
102109
103110 if (CommonXml .ATTRIBUTE_ARGUMENTS .equals (xmlTag .getName ())) {
104111 resultTag = PsiTreeUtil .getParentOfType (xmlTag , XmlTag .class );
Original file line number Diff line number Diff line change 55
66package com .magento .idea .magento2plugin .actions .generation ;
77
8+ import com .intellij .openapi .actionSystem .ActionUpdateThread ;
9+ import com .intellij .openapi .actionSystem .ActionUpdateThreadAware ;
810import com .intellij .openapi .actionSystem .AnActionEvent ;
911import com .intellij .openapi .actionSystem .PlatformDataKeys ;
1012import com .intellij .openapi .project .DumbAwareAction ;
1921import com .magento .idea .magento2plugin .util .GetFirstClassOfFile ;
2022import org .jetbrains .annotations .NotNull ;
2123
22- public class OverrideClassByAPreferenceAction extends DumbAwareAction {
24+ public class OverrideClassByAPreferenceAction extends DumbAwareAction
25+ implements ActionUpdateThreadAware {
2326 public static final String ACTION_NAME = "Override this class by a new Preference" ;
2427 public static final String ACTION_DESCRIPTION = "Create a new Magento 2 Preference" ;
2528 public static final String INTERFACE_ACTION = "Override this interface by a new Preference" ;
@@ -75,6 +78,11 @@ public boolean isDumbAware() {
7578 return false ;
7679 }
7780
81+ @ Override
82+ public @ NotNull ActionUpdateThread getActionUpdateThread () {
83+ return ActionUpdateThread .BGT ;
84+ }
85+
7886 private Pair <PsiFile , PhpClass > findPhpClass (@ NotNull final AnActionEvent event ) {
7987 final PsiFile psiFile = event .getData (PlatformDataKeys .PSI_FILE );
8088
You can’t perform that action at this time.
0 commit comments