Skip to content

Commit 6592c20

Browse files
870: Enhanced error outputting for new Magento 2 View Model generation
1 parent 7fee0e8 commit 6592c20

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.form

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
</constraints>
88
<properties>
99
<opaque value="true"/>
10-
<preferredSize width="420" height="120"/>
10+
<preferredSize width="440" height="150"/>
1111
<requestFocusEnabled value="true"/>
1212
</properties>
1313
<border type="none"/>
1414
<children>
15-
<grid id="90a70" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
15+
<grid id="90a70" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
1616
<margin top="0" left="0" bottom="0" right="0"/>
1717
<constraints>
1818
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -22,7 +22,7 @@
2222
<children>
2323
<component id="b0da4" class="javax.swing.JLabel">
2424
<constraints>
25-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
25+
<grid row="0" column="0" row-span="2" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
2626
<preferred-size width="113" height="16"/>
2727
</grid>
2828
</constraints>
@@ -44,7 +44,7 @@
4444
</component>
4545
<component id="29a9d" class="javax.swing.JTextField" binding="viewModelParentDir">
4646
<constraints>
47-
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
47+
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
4848
<preferred-size width="150" height="-1"/>
4949
</grid>
5050
</constraints>
@@ -55,7 +55,7 @@
5555
</component>
5656
<component id="b5004" class="javax.swing.JLabel">
5757
<constraints>
58-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
58+
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
5959
</constraints>
6060
<properties>
6161
<labelFor value="fdc52"/>
@@ -65,6 +65,22 @@
6565
<html.disable class="java.lang.Boolean" value="true"/>
6666
</clientProperties>
6767
</component>
68+
<component id="494ff" class="javax.swing.JLabel" binding="viewModelNameErrorMessage">
69+
<constraints>
70+
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
71+
</constraints>
72+
<properties>
73+
<text value=""/>
74+
</properties>
75+
</component>
76+
<component id="ac5fd" class="javax.swing.JLabel" binding="viewModelParentDirErrorMessage">
77+
<constraints>
78+
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
79+
</constraints>
80+
<properties>
81+
<text value=""/>
82+
</properties>
83+
</component>
6884
</children>
6985
</grid>
7086
<grid id="b0154" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.awt.event.WindowEvent;
2929
import javax.swing.JButton;
3030
import javax.swing.JComponent;
31+
import javax.swing.JLabel;
3132
import javax.swing.JPanel;
3233
import javax.swing.JTextField;
3334
import javax.swing.KeyStroke;
@@ -36,6 +37,8 @@ public class NewViewModelDialog extends AbstractDialog {
3637

3738
private static final String VIEW_MODEL_NAME = "View Model Name";
3839
private static final String VIEW_MODEL_DIR = "View Model Directory";
40+
41+
private final Project project;
3942
private final PsiDirectory baseDir;
4043
private final String moduleName;
4144

@@ -59,7 +62,8 @@ public class NewViewModelDialog extends AbstractDialog {
5962
message = {DirectoryRule.MESSAGE, VIEW_MODEL_DIR})
6063
private JTextField viewModelParentDir;
6164

62-
private final Project project;
65+
private JLabel viewModelNameErrorMessage;//NOPMD
66+
private JLabel viewModelParentDirErrorMessage;//NOPMD
6367

6468
/**
6569
* Constructor.

0 commit comments

Comments
 (0)