Skip to content

Commit 0256104

Browse files
author
Vitaliy
authored
Merge pull request #323 from eduard13/ui-form-fixes
Fixing the dialog size. Fixing adding new form fieldset
2 parents 2cfe5f4 + d4cbc20 commit 0256104

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="12" column-count="2" 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="888" height="657"/>
6+
<xy x="48" y="54" width="1056" height="1327"/>
77
</constraints>
88
<properties>
9-
<preferredSize width="400" height="600"/>
9+
<preferredSize width="838" height="619"/>
1010
</properties>
1111
<border type="none"/>
1212
<children>

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import com.magento.idea.magento2plugin.ui.table.TableButton;
5454
import com.magento.idea.magento2plugin.util.magento.GetAclResourcesListUtil;
5555
import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil;
56-
import java.awt.Dimension;
5756
import java.awt.event.ActionEvent;
5857
import java.awt.event.ActionListener;
5958
import java.awt.event.KeyEvent;
@@ -205,7 +204,6 @@ public class NewUiComponentFormDialog extends AbstractDialog {
205204
public NewUiComponentFormDialog(final Project project, final PsiDirectory directory) {
206205
super();
207206
this.project = project;
208-
updateDialogSizeToDefaults();
209207
formButtonsValidator = new FormButtonsValidator(this);
210208
formFieldsetsValidator = new FormFieldsetsValidator(this);
211209
formFieldsValidator = new FormFieldsValidator(this);
@@ -286,10 +284,11 @@ protected void initButtonsTable() {
286284
}
287285

288286
protected void initFieldSetsTable() {
287+
final Integer rowPosition = 10;
289288
final DefaultTableModel model = getFieldsetsModel();
290289
model.setDataVector(
291-
new Object[][] {{"general", "General","10",DELETE_COLUMN}},
292-
new Object[] { NAME_COLUMN, LABEL_COLUMN, SORT_ORDER_COLUMN, ACTION_COLUMN}
290+
new Object[][] {{"General", rowPosition, DELETE_COLUMN}},
291+
new Object[] { LABEL_COLUMN, SORT_ORDER_COLUMN, ACTION_COLUMN}
293292
);
294293

295294
final TableColumn column = fieldsets.getColumn(ACTION_COLUMN);
@@ -298,7 +297,7 @@ protected void initFieldSetsTable() {
298297
new DeleteRowButton(new JCheckBox()));
299298

300299
addFieldset.addActionListener(e -> {
301-
model.addRow(new Object[] {"","",DELETE_COLUMN});
300+
model.addRow(new Object[] {"", rowPosition + 10, DELETE_COLUMN});
302301
});
303302
model.addTableModelListener(
304303
event -> {
@@ -755,9 +754,4 @@ protected boolean validateFormFields() {
755754
&& formFieldsetsValidator.validate()
756755
&& formFieldsValidator.validate();
757756
}
758-
759-
private void updateDialogSizeToDefaults() {
760-
final Dimension screenSize = getToolkit().getScreenSize();
761-
setPreferredSize(new Dimension(screenSize.width / 2, screenSize.height / 2));
762-
}
763757
}

0 commit comments

Comments
 (0)