Skip to content

Commit e83ab09

Browse files
874: Enhanced error outputting for new Magento 2 models generation
1 parent 457429a commit e83ab09

File tree

2 files changed

+67
-13
lines changed

2 files changed

+67
-13
lines changed

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

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="10" left="10" bottom="10" right="10"/>
55
<constraints>
6-
<xy x="48" y="54" width="454" height="423"/>
6+
<xy x="48" y="54" width="454" height="426"/>
77
</constraints>
88
<properties>
9-
<preferredSize width="450" height="300"/>
9+
<preferredSize width="450" height="360"/>
1010
</properties>
1111
<border type="none"/>
1212
<children>
@@ -51,7 +51,7 @@
5151
</grid>
5252
</children>
5353
</grid>
54-
<grid id="e3588" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
54+
<grid id="e3588" layout-manager="GridLayoutManager" row-count="12" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
5555
<margin top="0" left="0" bottom="0" right="0"/>
5656
<constraints>
5757
<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"/>
@@ -77,39 +77,39 @@
7777
</component>
7878
<component id="c77c5" class="javax.swing.JTextField" binding="dbTableName">
7979
<constraints>
80-
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
80+
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
8181
<preferred-size width="150" height="-1"/>
8282
</grid>
8383
</constraints>
8484
<properties/>
8585
</component>
8686
<component id="4081c" class="javax.swing.JLabel" binding="dbTableNameLabel">
8787
<constraints>
88-
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
88+
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
8989
</constraints>
9090
<properties>
9191
<text value="DB Table Name"/>
9292
</properties>
9393
</component>
9494
<component id="80b3c" class="javax.swing.JLabel" binding="resourceModelLabel">
9595
<constraints>
96-
<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"/>
96+
<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"/>
9797
</constraints>
9898
<properties>
9999
<text value="Resource Model Name"/>
100100
</properties>
101101
</component>
102102
<component id="53105" class="javax.swing.JTextField" binding="resourceModelName">
103103
<constraints>
104-
<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">
104+
<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">
105105
<preferred-size width="150" height="-1"/>
106106
</grid>
107107
</constraints>
108108
<properties/>
109109
</component>
110110
<component id="4f1ae" class="javax.swing.JTextField" binding="entityIdColumn">
111111
<constraints>
112-
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
112+
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
113113
<preferred-size width="150" height="-1"/>
114114
</grid>
115115
</constraints>
@@ -119,15 +119,15 @@
119119
</component>
120120
<component id="cb7cf" class="javax.swing.JLabel" binding="entityIdColumnLabel">
121121
<constraints>
122-
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
122+
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
123123
</constraints>
124124
<properties>
125125
<text value="Entity ID Column"/>
126126
</properties>
127127
</component>
128128
<component id="a4d4e" class="javax.swing.JTextField" binding="collectionName">
129129
<constraints>
130-
<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">
130+
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
131131
<preferred-size width="150" height="-1"/>
132132
</grid>
133133
</constraints>
@@ -137,15 +137,15 @@
137137
</component>
138138
<component id="2763d" class="javax.swing.JLabel" binding="collectionNameLabel">
139139
<constraints>
140-
<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"/>
140+
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
141141
</constraints>
142142
<properties>
143143
<text value="Collection Name"/>
144144
</properties>
145145
</component>
146146
<component id="2c62a" class="javax.swing.JTextField" binding="collectionDirectory">
147147
<constraints>
148-
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
148+
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
149149
<preferred-size width="150" height="-1"/>
150150
</grid>
151151
</constraints>
@@ -155,12 +155,60 @@
155155
</component>
156156
<component id="ec37" class="javax.swing.JLabel" binding="collectionDirectoryLabel">
157157
<constraints>
158-
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
158+
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
159159
</constraints>
160160
<properties>
161161
<text value="Collection Directory"/>
162162
</properties>
163163
</component>
164+
<component id="81d78" class="javax.swing.JLabel" binding="modelNameErrorMessage">
165+
<constraints>
166+
<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"/>
167+
</constraints>
168+
<properties>
169+
<text value=""/>
170+
</properties>
171+
</component>
172+
<component id="37560" class="javax.swing.JLabel" binding="resourceModelNameErrorMessage">
173+
<constraints>
174+
<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"/>
175+
</constraints>
176+
<properties>
177+
<text value=""/>
178+
</properties>
179+
</component>
180+
<component id="a162b" class="javax.swing.JLabel" binding="dbTableNameErrorMessage">
181+
<constraints>
182+
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
183+
</constraints>
184+
<properties>
185+
<text value=""/>
186+
</properties>
187+
</component>
188+
<component id="53623" class="javax.swing.JLabel" binding="entityIdColumnErrorMessage">
189+
<constraints>
190+
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
191+
</constraints>
192+
<properties>
193+
<text value=""/>
194+
</properties>
195+
</component>
196+
<component id="6d038" class="javax.swing.JLabel" binding="collectionDirectoryErrorMessage">
197+
<constraints>
198+
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
199+
</constraints>
200+
<properties>
201+
<text value=""/>
202+
</properties>
203+
</component>
204+
<component id="ab299" class="javax.swing.JLabel" binding="collectionNameErrorMessage">
205+
<constraints>
206+
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
207+
</constraints>
208+
<properties>
209+
<text value=""/>
210+
</properties>
211+
</component>
164212
</children>
165213
</grid>
166214
</children>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ public class NewModelsDialog extends AbstractDialog {
9292
private JLabel entityIdColumnLabel;//NOPMD
9393
private JLabel collectionDirectoryLabel;//NOPMD
9494
private JLabel collectionNameLabel;//NOPMD
95+
private JLabel modelNameErrorMessage;//NOPMD
96+
private JLabel resourceModelNameErrorMessage;//NOPMD
97+
private JLabel dbTableNameErrorMessage;//NOPMD
98+
private JLabel entityIdColumnErrorMessage;//NOPMD
99+
private JLabel collectionDirectoryErrorMessage;//NOPMD
100+
private JLabel collectionNameErrorMessage;//NOPMD
95101

96102
/**
97103
* Open new dialog for adding new controller.

0 commit comments

Comments
 (0)