7
7
import com .intellij .ide .IdeView ;
8
8
import com .intellij .openapi .actionSystem .*;
9
9
import com .intellij .openapi .project .Project ;
10
- import com .intellij .openapi .util .Key ;
11
10
import com .intellij .psi .PsiDirectory ;
12
- import com .intellij .psi .PsiElement ;
13
- import com .jetbrains .php .lang .psi .PhpFile ;
14
- import com .jetbrains .php .lang .psi .elements .Method ;
15
11
import com .magento .idea .magento2plugin .MagentoIcons ;
16
12
import com .magento .idea .magento2plugin .actions .generation .dialog .NewBlockDialog ;
17
- import com .magento .idea .magento2plugin .actions .generation .generator .code .PluginMethodsGenerator ;
18
- import com .magento .idea .magento2plugin .magento .files .RegistrationPhp ;
19
- import com .magento .idea .magento2plugin .project .Settings ;
20
13
import org .jetbrains .annotations .NotNull ;
21
14
22
15
public class NewBlockAction extends AnAction {
@@ -27,26 +20,20 @@ public class NewBlockAction extends AnAction {
27
20
super (ACTION_NAME , ACTION_DESCRIPTION , MagentoIcons .MODULE );
28
21
}
29
22
30
- /**
31
- * Triggers when new item is clicked
32
- */
33
23
@ Override
34
24
public void actionPerformed (@ NotNull AnActionEvent e ) {
35
25
DataContext dataContext = e .getDataContext ();
36
26
IdeView view = LangDataKeys .IDE_VIEW .getData (dataContext );
37
-
38
27
if (view == null ) {
39
28
return ;
40
29
}
41
30
42
31
Project project = CommonDataKeys .PROJECT .getData (dataContext );
43
-
44
32
if (project == null ) {
45
33
return ;
46
34
}
47
35
48
36
PsiDirectory directory = view .getOrChooseDirectory ();
49
-
50
37
if (directory == null ) {
51
38
return ;
52
39
}
0 commit comments