File tree 3 files changed +24
-1
lines changed
src/com/magento/idea/magento2plugin/actions/generation/dialog
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
1
validator.notEmpty =The {0} field must not be empty
2
2
validator.box.notEmpty =The {0} field must contain a valid selection from the dropdown
3
3
validator.package.validPath =Please specify a valid Magento 2 installation path
4
+ validator.properties.notEmpty =The properties must not be empty
4
5
validator.alphaNumericCharacters =The {0} field must contain letters and numbers only
5
6
validator.alphaNumericAndUnderscoreCharacters ={0} must contain letters, numbers and underscores only
6
7
validator.alphaAndPeriodCharacters =The {0} field must contain alphabets and periods only
Original file line number Diff line number Diff line change 10
10
</properties >
11
11
<border type =" none" />
12
12
<children >
13
- <grid id =" e3588" layout-manager =" GridLayoutManager" row-count =" 3 " column-count =" 2" same-size-horizontally =" false" same-size-vertically =" false" hgap =" -1" vgap =" -1" >
13
+ <grid id =" e3588" layout-manager =" GridLayoutManager" row-count =" 4 " column-count =" 2" same-size-horizontally =" false" same-size-vertically =" false" hgap =" -1" vgap =" -1" >
14
14
<margin top =" 0" left =" 0" bottom =" 0" right =" 0" />
15
15
<constraints >
16
16
<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" />
36
36
<text value =" " />
37
37
</properties >
38
38
</component >
39
+ <component id =" 8fecc" class =" javax.swing.JLabel" binding =" modelNameErrorMessage" >
40
+ <constraints >
41
+ <grid row =" 2" column =" 1" row-span =" 1" col-span =" 1" vsize-policy =" 0" hsize-policy =" 0" anchor =" 8" fill =" 0" indent =" 0" use-parent-layout =" false" />
42
+ </constraints >
43
+ <properties >
44
+ <text value =" " />
45
+ </properties >
46
+ </component >
39
47
</children >
40
48
</grid >
41
49
<grid id =" ebe15" layout-manager =" GridLayoutManager" row-count =" 3" column-count =" 1" same-size-horizontally =" false" same-size-vertically =" false" hgap =" -1" vgap =" -1" >
Original file line number Diff line number Diff line change 40
40
import javax .swing .JButton ;
41
41
import javax .swing .JCheckBox ;
42
42
import javax .swing .JComponent ;
43
+ import javax .swing .JLabel ;
43
44
import javax .swing .JOptionPane ;
44
45
import javax .swing .JPanel ;
45
46
import javax .swing .JTable ;
@@ -77,6 +78,8 @@ public class NewDataModelDialog extends AbstractDialog {
77
78
@ FieldValidation (rule = RuleRegistry .PHP_CLASS , message = {PhpClassRule .MESSAGE , MODEL_NAME })
78
79
private JTextField modelName ;
79
80
81
+ private JLabel modelNameErrorMessage ;//NOPMD
82
+
80
83
/**
81
84
* Constructor.
82
85
*/
@@ -162,6 +165,17 @@ protected boolean validateFormFields() {
162
165
valid = true ;
163
166
final String errorTitle = commonBundle .message ("common.error" );
164
167
final int column = 0 ;
168
+
169
+ if (propertyTable .getRowCount () == 0 ) {
170
+ valid = false ;
171
+ JOptionPane .showMessageDialog (
172
+ null ,
173
+ validatorBundle .message ("validator.properties.notEmpty" ),
174
+ errorTitle ,
175
+ JOptionPane .ERROR_MESSAGE
176
+ );
177
+ }
178
+
165
179
for (int row = 0 ; row < propertyTable .getRowCount (); row ++) {
166
180
final String propertyName = ((String ) propertyTable .getValueAt (row , column )).trim ();
167
181
if (propertyName .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments