7
7
8
8
import com .intellij .openapi .project .Project ;
9
9
import com .intellij .psi .PsiDirectory ;
10
- import com .intellij .psi .PsiFile ;
11
10
import com .magento .idea .magento2plugin .actions .generation .NewBlockAction ;
12
11
import com .magento .idea .magento2plugin .actions .generation .data .BlockFileData ;
13
12
import com .magento .idea .magento2plugin .actions .generation .dialog .validator .annotation .FieldValidation ;
26
25
import java .awt .event .WindowEvent ;
27
26
import javax .swing .JButton ;
28
27
import javax .swing .JComponent ;
28
+ import javax .swing .JLabel ;
29
29
import javax .swing .JPanel ;
30
30
import javax .swing .JRadioButton ;
31
31
import javax .swing .JTextField ;
32
32
import javax .swing .JTextPane ;
33
33
import javax .swing .KeyStroke ;
34
34
35
35
public class NewBlockDialog extends AbstractDialog {
36
+
36
37
private final PsiDirectory baseDir ;
37
38
private final String moduleName ;
38
39
private JPanel contentPanel ;
@@ -44,18 +45,18 @@ public class NewBlockDialog extends AbstractDialog {
44
45
private static final String NAME = "name" ;
45
46
private static final String DIRECTORY = "directory" ;
46
47
47
- @ FieldValidation (rule = RuleRegistry .NOT_EMPTY ,
48
- message = {NotEmptyRule .MESSAGE , NAME })
49
- @ FieldValidation (rule = RuleRegistry .PHP_CLASS ,
50
- message = {PhpClassRule .MESSAGE , NAME })
48
+ @ FieldValidation (rule = RuleRegistry .NOT_EMPTY , message = {NotEmptyRule .MESSAGE , NAME })
49
+ @ FieldValidation (rule = RuleRegistry .PHP_CLASS , message = {PhpClassRule .MESSAGE , NAME })
51
50
private JTextField blockName ;
52
51
53
- @ FieldValidation (rule = RuleRegistry .NOT_EMPTY ,
54
- message = {NotEmptyRule .MESSAGE , DIRECTORY })
52
+ @ FieldValidation (rule = RuleRegistry .NOT_EMPTY , message = {NotEmptyRule .MESSAGE , DIRECTORY })
55
53
@ FieldValidation (rule = RuleRegistry .PHP_DIRECTORY ,
56
54
message = {PhpDirectoryRule .MESSAGE , DIRECTORY })
57
55
private JTextField blockParentDir ;
58
56
57
+ private JLabel blockNameErrorMessage ;//NOPMD
58
+ private JLabel blockParentDirErrorMessage ;//NOPMD
59
+
59
60
/**
60
61
* Constructor.
61
62
*
@@ -113,8 +114,8 @@ public static void open(final Project project, final PsiDirectory directory) {
113
114
protected void onOK () {
114
115
if (validateFormFields ()) {
115
116
generateFile ();
117
+ exit ();
116
118
}
117
- exit ();
118
119
}
119
120
120
121
private void generateFile () {
0 commit comments