Skip to content

Commit 18a1b2b

Browse files
872: Enhanced error outputting for new Magento 2 CLI Command generation
1 parent cd7bcd4 commit 18a1b2b

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

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

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</properties>
1717
<border type="none"/>
1818
<children>
19-
<grid id="bce24" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
19+
<grid id="bce24" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
2020
<margin top="10" left="10" bottom="10" right="10"/>
2121
<constraints>
2222
<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,7 +36,7 @@
3636
</component>
3737
<component id="82342" class="javax.swing.JTextField" binding="cliCommandParentDirectoryField">
3838
<constraints>
39-
<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">
39+
<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">
4040
<preferred-size width="150" height="-1"/>
4141
</grid>
4242
</constraints>
@@ -46,7 +46,7 @@
4646
</component>
4747
<component id="a06d9" class="javax.swing.JTextField" binding="cliCommandNameField">
4848
<constraints>
49-
<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">
49+
<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">
5050
<preferred-size width="150" height="-1"/>
5151
</grid>
5252
</constraints>
@@ -65,7 +65,7 @@
6565
</component>
6666
<component id="f6c65" class="javax.swing.JLabel">
6767
<constraints>
68-
<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"/>
68+
<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"/>
6969
</constraints>
7070
<properties>
7171
<labelFor value="82342"/>
@@ -74,7 +74,7 @@
7474
</component>
7575
<component id="8696b" class="javax.swing.JLabel">
7676
<constraints>
77-
<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"/>
77+
<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"/>
7878
</constraints>
7979
<properties>
8080
<labelFor value="a06d9"/>
@@ -83,7 +83,7 @@
8383
</component>
8484
<component id="abeb0" class="javax.swing.JLabel">
8585
<constraints>
86-
<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"/>
86+
<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"/>
8787
</constraints>
8888
<properties>
8989
<labelFor value="d786e"/>
@@ -93,7 +93,7 @@
9393
<grid id="5f3c" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
9494
<margin top="0" left="0" bottom="0" right="0"/>
9595
<constraints>
96-
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
96+
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
9797
</constraints>
9898
<properties/>
9999
<border type="none"/>
@@ -128,7 +128,7 @@
128128
</grid>
129129
<component id="d786e" class="javax.swing.JTextArea" binding="cliCommandDescriptionField">
130130
<constraints>
131-
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
131+
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
132132
<preferred-size width="150" height="50"/>
133133
</grid>
134134
</constraints>
@@ -137,6 +137,38 @@
137137
<wrapStyleWord value="false"/>
138138
</properties>
139139
</component>
140+
<component id="12960" class="javax.swing.JLabel" binding="cliCommandClassNameFieldErrorMessage">
141+
<constraints>
142+
<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"/>
143+
</constraints>
144+
<properties>
145+
<text value=""/>
146+
</properties>
147+
</component>
148+
<component id="6605a" class="javax.swing.JLabel" binding="cliCommandParentDirectoryFieldErrorMessage">
149+
<constraints>
150+
<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"/>
151+
</constraints>
152+
<properties>
153+
<text value=""/>
154+
</properties>
155+
</component>
156+
<component id="492bc" class="javax.swing.JLabel" binding="cliCommandNameFieldErrorMessage">
157+
<constraints>
158+
<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"/>
159+
</constraints>
160+
<properties>
161+
<text value=""/>
162+
</properties>
163+
</component>
164+
<component id="68d06" class="javax.swing.JLabel" binding="cliCommandDescriptionFieldErrorMessage">
165+
<constraints>
166+
<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"/>
167+
</constraints>
168+
<properties>
169+
<text value=""/>
170+
</properties>
171+
</component>
140172
</children>
141173
</grid>
142174
</children>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Locale;
3131
import javax.swing.JButton;
3232
import javax.swing.JComponent;
33+
import javax.swing.JLabel;
3334
import javax.swing.JOptionPane;
3435
import javax.swing.JPanel;
3536
import javax.swing.JTextArea;
@@ -71,6 +72,11 @@ public class NewCLICommandDialog extends AbstractDialog {
7172
message = {NotEmptyRule.MESSAGE, COMMAND_DESCRIPTION})
7273
private JTextArea cliCommandDescriptionField;
7374

75+
private JLabel cliCommandClassNameFieldErrorMessage;//NOPMD
76+
private JLabel cliCommandParentDirectoryFieldErrorMessage;//NOPMD
77+
private JLabel cliCommandNameFieldErrorMessage;//NOPMD
78+
private JLabel cliCommandDescriptionFieldErrorMessage;//NOPMD
79+
7480
private final CommonBundle commonBundle;
7581
private final Project project;
7682
private final String moduleName;

0 commit comments

Comments
 (0)