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 1717import com .magento .idea .magento2plugin .actions .generation .dialog .NewModelsDialog ;
1818
1919public class NewModelsAction extends AnAction {
20+
2021 public static final String ACTION_NAME = "Magento 2 Models" ;
2122 public static final String ACTION_DESCRIPTION = "Create a new Magento 2 models" ;
2223
@@ -35,17 +36,16 @@ public void actionPerformed(final AnActionEvent event) {
3536 if (view == null ) {
3637 return ;
3738 }
38-
3939 final Project project = CommonDataKeys .PROJECT .getData (dataContext );
40+
4041 if (project == null ) {
4142 return ;
4243 }
43-
4444 final PsiDirectory directory = view .getOrChooseDirectory ();
45+
4546 if (directory == null ) {
4647 return ;
4748 }
48-
4949 NewModelsDialog .open (project , directory );
5050 }
5151
Original file line number Diff line number Diff line change 3535
3636@ SuppressWarnings ("PMD.TooManyFields" )
3737public class NewModelsDialog extends AbstractDialog {
38+
3839 private final String moduleName ;
3940 private final Project project ;
4041 private JPanel contentPane ;
@@ -160,11 +161,6 @@ public static void open(
160161 dialog .setVisible (true );
161162 }
162163
163- @ Override
164- protected void onCancel () {
165- dispose ();
166- }
167-
168164 /**
169165 * Process generation.
170166 */
@@ -173,8 +169,8 @@ private void onOK() {
173169 generateModelFile ();
174170 generateResourceModelFile ();
175171 generateCollectionFile ();
172+ exit ();
176173 }
177- exit ();
178174 }
179175
180176 /**
You can’t perform that action at this time.
0 commit comments