File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
src/com/magento/idea/magento2plugin/actions/generation/dialog Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 11validator.notEmpty =The {0} field must not be empty
22validator.box.notEmpty =The {0} field must contain a valid selection from the dropdown
33validator.package.validPath =Please specify a valid Magento 2 installation path
4+ validator.properties.notEmpty =The properties must not be empty
45validator.alphaNumericCharacters =The {0} field must contain letters and numbers only
56validator.alphaNumericAndUnderscoreCharacters ={0} must contain letters, numbers and underscores only
67validator.alphaAndPeriodCharacters =The {0} field must contain alphabets and periods only
Original file line number Diff line number Diff line change 1010 </properties >
1111 <border type =" none" />
1212 <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" >
1414 <margin top =" 0" left =" 0" bottom =" 0" right =" 0" />
1515 <constraints >
1616 <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" />
3636 <text value =" " />
3737 </properties >
3838 </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 >
3947 </children >
4048 </grid >
4149 <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 4040import javax .swing .JButton ;
4141import javax .swing .JCheckBox ;
4242import javax .swing .JComponent ;
43+ import javax .swing .JLabel ;
4344import javax .swing .JOptionPane ;
4445import javax .swing .JPanel ;
4546import javax .swing .JTable ;
@@ -77,6 +78,8 @@ public class NewDataModelDialog extends AbstractDialog {
7778 @ FieldValidation (rule = RuleRegistry .PHP_CLASS , message = {PhpClassRule .MESSAGE , MODEL_NAME })
7879 private JTextField modelName ;
7980
81+ private JLabel modelNameErrorMessage ;//NOPMD
82+
8083 /**
8184 * Constructor.
8285 */
@@ -162,6 +165,17 @@ protected boolean validateFormFields() {
162165 valid = true ;
163166 final String errorTitle = commonBundle .message ("common.error" );
164167 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+
165179 for (int row = 0 ; row < propertyTable .getRowCount (); row ++) {
166180 final String propertyName = ((String ) propertyTable .getValueAt (row , column )).trim ();
167181 if (propertyName .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments