12
12
import com .magento .idea .magento2plugin .actions .generation .data .ModuleComposerJsonData ;
13
13
import com .magento .idea .magento2plugin .actions .generation .data .ModuleRegistrationPhpData ;
14
14
import com .magento .idea .magento2plugin .actions .generation .data .ModuleXmlData ;
15
- import com .magento .idea .magento2plugin .actions .generation .dialog .validator .NewModuleDialogValidator ;
16
15
import com .magento .idea .magento2plugin .actions .generation .generator .ModuleComposerJsonGenerator ;
17
16
import com .magento .idea .magento2plugin .actions .generation .generator .ModuleRegistrationPhpGenerator ;
18
17
import com .magento .idea .magento2plugin .actions .generation .generator .ModuleXmlGenerator ;
24
23
import com .magento .idea .magento2plugin .util .CamelCaseToHyphen ;
25
24
import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
26
25
import java .awt .event .ActionEvent ;
27
- import java .awt .event .ActionListener ;
28
26
import java .awt .event .KeyEvent ;
29
27
import java .awt .event .WindowAdapter ;
30
28
import java .awt .event .WindowEvent ;
@@ -50,7 +48,6 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
50
48
private final Project project ;
51
49
@ NotNull
52
50
private final PsiDirectory initialBaseDir ;
53
- private final NewModuleDialogValidator validator ;
54
51
private final CamelCaseToHyphen camelCaseToHyphen ;
55
52
private JPanel contentPane ;
56
53
private JButton buttonOK ;
@@ -90,7 +87,6 @@ public NewModuleDialog(
90
87
this .project = project ;
91
88
this .initialBaseDir = initialBaseDir ;
92
89
this .camelCaseToHyphen = CamelCaseToHyphen .getInstance ();
93
- this .validator = NewModuleDialogValidator .getInstance (this );
94
90
this .moduleIndex = ModuleIndex .getInstance (project );
95
91
detectPackageName (initialBaseDir );
96
92
setContentPane (contentPane );
@@ -102,19 +98,8 @@ public NewModuleDialog(
102
98
moduleLicenseCustom .setToolTipText ("Custom License Name" );
103
99
moduleLicenseCustom .setText (Settings .getDefaultLicenseName (project ));
104
100
105
- buttonOK .addActionListener (new ActionListener () {
106
- @ Override
107
- public void actionPerformed (final ActionEvent event ) {
108
- onOK ();
109
- }
110
- });
111
-
112
- buttonCancel .addActionListener (new ActionListener () {
113
- @ Override
114
- public void actionPerformed (final ActionEvent event ) {
115
- onCancel ();
116
- }
117
- });
101
+ buttonOK .addActionListener ((final ActionEvent event ) -> onOK ());
102
+ buttonCancel .addActionListener ((final ActionEvent event ) -> onCancel ());
118
103
119
104
setDefaultCloseOperation (DO_NOTHING_ON_CLOSE );
120
105
addWindowListener (new WindowAdapter () {
@@ -124,13 +109,11 @@ public void windowClosing(final WindowEvent event) {
124
109
}
125
110
});
126
111
127
- contentPane .registerKeyboardAction (new ActionListener () {
128
- @ Override
129
- public void actionPerformed (final ActionEvent event ) {
130
- onCancel ();
131
- }
132
- }, KeyStroke .getKeyStroke (KeyEvent .VK_ESCAPE , 0 ),
133
- JComponent .WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
112
+ contentPane .registerKeyboardAction (
113
+ (final ActionEvent event ) -> onCancel (),
114
+ KeyStroke .getKeyStroke (KeyEvent .VK_ESCAPE , 0 ),
115
+ JComponent .WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
116
+ );
134
117
}
135
118
136
119
private void detectPackageName (final @ NotNull PsiDirectory initialBaseDir ) {
@@ -143,7 +126,7 @@ private void detectPackageName(final @NotNull PsiDirectory initialBaseDir) {
143
126
}
144
127
145
128
protected void onOK () {
146
- if (!validator . validate () ) {
129
+ if (!validateFormFields ) {
147
130
return ;
148
131
}
149
132
generateFiles ();
0 commit comments