Skip to content

Commit ded43de

Browse files
Added ui components tab toggling
1 parent f57f07b commit ded43de

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@
1818
<preferred-size width="200" height="200"/>
1919
</grid>
2020
</constraints>
21-
<properties/>
21+
<properties>
22+
<enabled value="true"/>
23+
<visible value="true"/>
24+
</properties>
2225
<border type="none"/>
2326
<children>
2427
<grid id="6be8b" binding="generalTable" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
2528
<margin top="10" left="10" bottom="0" right="10"/>
2629
<constraints>
2730
<tabbedpane title="General"/>
2831
</constraints>
29-
<properties/>
32+
<properties>
33+
<enabled value="true"/>
34+
<visible value="false"/>
35+
</properties>
3036
<border type="none"/>
3137
<children>
3238
<component id="210a4" class="javax.swing.JLabel" binding="entityNameLabel">
@@ -137,12 +143,19 @@
137143
</vspacer>
138144
</children>
139145
</grid>
140-
<grid id="e3309" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
146+
<grid id="e3309" binding="uiComponentsPanel" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
141147
<margin top="10" left="10" bottom="0" right="10"/>
142148
<constraints>
143149
<tabbedpane title="Admin UI Components"/>
144150
</constraints>
145-
<properties/>
151+
<properties>
152+
<background color="-12828863"/>
153+
<enabled value="true"/>
154+
<visible value="true"/>
155+
</properties>
156+
<clientProperties>
157+
<html.disable class="java.lang.Boolean" value="false"/>
158+
</clientProperties>
146159
<border type="none" title=""/>
147160
<children>
148161
<component id="3c721" class="javax.swing.JTextField" binding="route">

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public class NewEntityDialog extends AbstractDialog {
196196
private static final String GRID_NAME = "Grit Name";
197197
private static final String IDENTIFIER = "Identifier";
198198
private static final String SORT_ORDER = "Sort Order";
199+
private static final String UI_COMPONENTS_TAB_NAME = "Admin UI Components";
199200

200201
@FieldValidation(rule = RuleRegistry.NOT_EMPTY, message = {NotEmptyRule.MESSAGE, FORM_NAME})
201202
@FieldValidation(rule = RuleRegistry.IDENTIFIER, message = {IdentifierRule.MESSAGE})
@@ -221,6 +222,7 @@ public class NewEntityDialog extends AbstractDialog {
221222
private JTextPane exampleAclId;
222223
private JTextPane exampleFormName;
223224
private JTextPane exampleGridName;
225+
private JPanel uiComponentsPanel;
224226
private JTextField observerName;
225227

226228
/**
@@ -269,6 +271,10 @@ protected void textChanged(final @NotNull DocumentEvent event) {
269271
autoCompleteIdentifiers();
270272
}
271273
});
274+
275+
toggleUiComponentsPanel();
276+
277+
createUiComponent.addItemListener(event -> toggleUiComponentsPanel());
272278
}
273279

274280
/**
@@ -1399,4 +1405,16 @@ private void autoCompleteIdentifiers() {
13991405
menuIdentifier.setText(getModuleName().concat("::management"));
14001406
menuTitle.setText(entityNameLabel.concat(" Management"));
14011407
}
1408+
1409+
/**
1410+
* Resolve ui components panel state.
1411+
*/
1412+
private void toggleUiComponentsPanel() {
1413+
if (createUiComponent.isSelected()) {
1414+
tabbedPane1.add(uiComponentsPanel, 1);
1415+
tabbedPane1.setTitleAt(1, UI_COMPONENTS_TAB_NAME);
1416+
} else {
1417+
tabbedPane1.remove(1);
1418+
}
1419+
}
14021420
}

0 commit comments

Comments
 (0)