Skip to content

Commit bb39492

Browse files
committed
2490: Enhance dialog constructors with detailed Javadoc comments
Updated constructors in `NewSetupDataPatchDialog` and `NewLayoutTemplateDialog` with detailed Javadoc comments. These updates provide clarity on their purpose, parameters, and behaviors, improving code readability and maintainability.
1 parent 616d09c commit bb39492

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewLayoutTemplateDialog.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public class NewLayoutTemplateDialog extends AbstractDialog {
5252
private JButton buttonCancel;
5353

5454
@FieldValidation(rule = RuleRegistry.NOT_EMPTY, message = {NotEmptyRule.MESSAGE, LAYOUT_NAME})
55-
@FieldValidation(rule = RuleRegistry.LAYOUT_NAME, message = {IdentifierRule.MESSAGE, LAYOUT_NAME})
55+
@FieldValidation(
56+
rule = RuleRegistry.LAYOUT_NAME,
57+
message = {IdentifierRule.MESSAGE, LAYOUT_NAME}
58+
)
5659
private JTextField layoutName;
5760

5861
private JComboBox<ComboBoxItemData> area;
@@ -62,6 +65,13 @@ public class NewLayoutTemplateDialog extends AbstractDialog {
6265
private JLabel areaLabel;
6366
private JLabel layoutNameErrorMessage;
6467

68+
/**
69+
* Constructs a new dialog for creating a layout template, initializing its components and setting
70+
* default behaviors such as focus and button actions.
71+
*
72+
* @param project The current IntelliJ project associated with the dialog.
73+
* @param directory The PsiDirectory where the new layout will be created.
74+
*/
6575
public NewLayoutTemplateDialog(final Project project, final PsiDirectory directory) {
6676
super();
6777

@@ -103,6 +113,9 @@ public static void open(final Project project, final PsiDirectory directory) {
103113
dialog.setVisible(true);
104114
}
105115

116+
/**
117+
* Handles the action performed when the OK button is clicked in the dialog.
118+
*/
106119
protected void onWriteActionOK() {
107120

108121
if (validateFormFields()) {

src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewSetupDataPatchDialog.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ public class NewSetupDataPatchDialog extends AbstractDialog {
4848
private JLabel classNameErrorMessage;
4949

5050
/**
51-
* Constructor
51+
* Constructs a new instance of the NewSetupDataPatchDialog.
52+
* This dialog facilitates the creation of a new Magento 2 Setup Data Patch,
53+
* allowing the user to provide necessary module details and interact with a graphical user interface.
54+
*
55+
* @param project The current IntelliJ IDEA project context.
56+
* @param directory The base directory where the Setup Data Patch will be created.
57+
* @param modulePackage The package name of the target Magento 2 module.
58+
* @param moduleName The name of the target Magento 2 module.
5259
*/
5360
public NewSetupDataPatchDialog(
5461
Project project,
@@ -91,7 +98,7 @@ public void windowClosing(WindowEvent event) {
9198
}
9299

93100
/**
94-
* Open dialog
101+
* Open dialog.
95102
*/
96103
public static void open(
97104
Project project,

0 commit comments

Comments
 (0)