53
53
import com .magento .idea .magento2plugin .ui .table .TableButton ;
54
54
import com .magento .idea .magento2plugin .util .magento .GetAclResourcesListUtil ;
55
55
import com .magento .idea .magento2plugin .util .magento .GetModuleNameByDirectoryUtil ;
56
- import java .awt .Dimension ;
57
56
import java .awt .event .ActionEvent ;
58
57
import java .awt .event .ActionListener ;
59
58
import java .awt .event .KeyEvent ;
@@ -205,7 +204,6 @@ public class NewUiComponentFormDialog extends AbstractDialog {
205
204
public NewUiComponentFormDialog (final Project project , final PsiDirectory directory ) {
206
205
super ();
207
206
this .project = project ;
208
- updateDialogSizeToDefaults ();
209
207
formButtonsValidator = new FormButtonsValidator (this );
210
208
formFieldsetsValidator = new FormFieldsetsValidator (this );
211
209
formFieldsValidator = new FormFieldsValidator (this );
@@ -286,10 +284,11 @@ protected void initButtonsTable() {
286
284
}
287
285
288
286
protected void initFieldSetsTable () {
287
+ final Integer rowPosition = 10 ;
289
288
final DefaultTableModel model = getFieldsetsModel ();
290
289
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 }
293
292
);
294
293
295
294
final TableColumn column = fieldsets .getColumn (ACTION_COLUMN );
@@ -298,7 +297,7 @@ protected void initFieldSetsTable() {
298
297
new DeleteRowButton (new JCheckBox ()));
299
298
300
299
addFieldset .addActionListener (e -> {
301
- model .addRow (new Object [] {"" ,"" , DELETE_COLUMN });
300
+ model .addRow (new Object [] {"" , rowPosition + 10 , DELETE_COLUMN });
302
301
});
303
302
model .addTableModelListener (
304
303
event -> {
@@ -755,9 +754,4 @@ protected boolean validateFormFields() {
755
754
&& formFieldsetsValidator .validate ()
756
755
&& formFieldsValidator .validate ();
757
756
}
758
-
759
- private void updateDialogSizeToDefaults () {
760
- final Dimension screenSize = getToolkit ().getScreenSize ();
761
- setPreferredSize (new Dimension (screenSize .width / 2 , screenSize .height / 2 ));
762
- }
763
757
}
0 commit comments