File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
src/com/magento/idea/magento2plugin/actions/generation Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 17
17
import com .magento .idea .magento2plugin .actions .generation .dialog .NewModelsDialog ;
18
18
19
19
public class NewModelsAction extends AnAction {
20
+
20
21
public static final String ACTION_NAME = "Magento 2 Models" ;
21
22
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 models" ;
22
23
@@ -35,17 +36,16 @@ public void actionPerformed(final AnActionEvent event) {
35
36
if (view == null ) {
36
37
return ;
37
38
}
38
-
39
39
final Project project = CommonDataKeys .PROJECT .getData (dataContext );
40
+
40
41
if (project == null ) {
41
42
return ;
42
43
}
43
-
44
44
final PsiDirectory directory = view .getOrChooseDirectory ();
45
+
45
46
if (directory == null ) {
46
47
return ;
47
48
}
48
-
49
49
NewModelsDialog .open (project , directory );
50
50
}
51
51
Original file line number Diff line number Diff line change 35
35
36
36
@ SuppressWarnings ("PMD.TooManyFields" )
37
37
public class NewModelsDialog extends AbstractDialog {
38
+
38
39
private final String moduleName ;
39
40
private final Project project ;
40
41
private JPanel contentPane ;
@@ -160,11 +161,6 @@ public static void open(
160
161
dialog .setVisible (true );
161
162
}
162
163
163
- @ Override
164
- protected void onCancel () {
165
- dispose ();
166
- }
167
-
168
164
/**
169
165
* Process generation.
170
166
*/
@@ -173,8 +169,8 @@ private void onOK() {
173
169
generateModelFile ();
174
170
generateResourceModelFile ();
175
171
generateCollectionFile ();
172
+ exit ();
176
173
}
177
- exit ();
178
174
}
179
175
180
176
/**
You can’t perform that action at this time.
0 commit comments