diff --git a/CHANGELOG.md b/CHANGELOG.md index 96792c157..3a1a26c0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). +## 2025.0.1 + +### Fixed + +- Fixed compatibility with PhpStorm/IntelliJ 2025.* [#2495](https://github.com/magento/magento2-phpstorm-plugin/pull/2495) + ## 2025.0.0 ### Added diff --git a/README.md b/README.md index 6215b9cfa..20e56b464 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,18 @@ # PhpStorm Magento 2 Plugin -This is a PhpStorm IDE plugin for a better Magento 2 development workflow. - -## Version 2025.0.0 - Contributors - + + + + + + + + + + + + +
+This is a PhpStorm IDE plugin for a better Magento 2 development workflow. +
+ Version 2025.0.0 - Contributors +
@@ -35,13 +42,36 @@ This is a PhpStorm IDE plugin for a better Magento 2 development workflow.
+

Support the Project

+

If you find this plugin helpful and want to support its development, consider buying the contributors a coffee:

+ + Buy Me a Coffee + +

Thank you to our sponsors—your support means everything:

+

Lucas van Staden

+

Ivan Chepurnyi

+
-### Support the Project - -If you find this plugin helpful and want to support its development, consider buying the contributors a coffee: +## Features -[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate-orange.svg)](https://buymeacoffee.com/vitalii_b) +* Configuration smart completion and references for XML/JavaScript files +* `Navigate to configuration` reference in scope of class/interface +* `Go to plugin` reference in scope of class/interface and method +* `Navigate to Web API configuration` reference in scope of class/interface and method +* Plugin class methods generation +* Plugin declaration inspection +* RequireJS reference navigation and completion +* MFTF reference navigation and completion +* GraphQL navigation line markers +* Code generation +* Inspections for XML configuration @@ -63,20 +93,6 @@ If you find this plugin helpful and want to support its development, consider bu * PhpStorm >= 2023.1 * JRE >= 17 -## Features - -* Configuration smart completion and references for XML/JavaScript files -* `Navigate to configuration` reference in scope of class/interface -* `Go to plugin` reference in scope of class/interface and method -* `Navigate to Web API configuration` reference in scope of class/interface and method -* Plugin class methods generation -* Plugin declaration inspection -* RequireJS reference navigation and completion -* MFTF reference navigation and completion -* GraphQL navigation line markers -* Code generation -* Inspections for XML configuration - ## Setting up development environment 1. Check out this repository diff --git a/gradle.properties b/gradle.properties index d1d93e5c2..8597e8be4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ pluginGroup = com.magento.idea.magento2plugin pluginName = Magento PhpStorm pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin -pluginVersion = 2025.0.0 +pluginVersion = 2025.0.1 pluginSinceBuild = 233 -pluginUntilBuild = 248.* +pluginUntilBuild = 258.* platformType = PS platformVersion = 2024.3 platformPlugins = diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java index c829bd732..92a5e3276 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java @@ -17,7 +17,6 @@ import com.intellij.psi.PsiFile; import com.intellij.psi.PsiReference; import com.intellij.psi.tree.IElementType; -import com.intellij.util.SlowOperations; import com.jetbrains.php.lang.lexer.PhpTokenTypes; import com.jetbrains.php.lang.psi.PhpFile; import com.jetbrains.php.lang.psi.elements.Method; @@ -133,7 +132,7 @@ private boolean checkIsEventDispatchMethod(final MethodReference element) { if (elementReference == null) { return false; } - final PsiElement method = SlowOperations.allowSlowOperations(elementReference::resolve); + final PsiElement method = elementReference.resolve(); if (!(method instanceof Method)) { return false; } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java index 1736a00a4..eea0070c8 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java @@ -5,6 +5,7 @@ package com.magento.idea.magento2plugin.actions.generation.dialog; +import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.util.Pair; import com.magento.idea.magento2plugin.actions.generation.data.ui.ComboBoxItemData; import com.magento.idea.magento2plugin.actions.generation.dialog.prompt.PlaceholderInitializerUtil; @@ -35,10 +36,13 @@ /** * All code generate dialog should extend this class. */ +@SuppressWarnings({ + "PMD.TooManyMethods" +}) public abstract class AbstractDialog extends JDialog { - protected CommonBundle bundle; - protected final ValidatorBundle validatorBundle = new ValidatorBundle(); + protected transient CommonBundle bundle; + protected final transient ValidatorBundle validatorBundle = new ValidatorBundle(); protected final List fieldsValidationsList; private final String errorTitle; private JTabbedPane tabbedPane; @@ -75,12 +79,37 @@ protected void exit() { dispose(); } + /** + * Executes onOK within a WriteAction context. + */ + protected final void executeOnOk() { + WriteAction.run(this::onWriteActionOK); + } + + /** + * This method should contain the core logic for onOk. + * Subclasses can override to provide their implementation. + * Must be invoked via executeOnOk(). + */ + protected abstract void onWriteActionOK(); + + /** + * Hook executed when the OK button is pressed. + */ + protected final void onOK() { + executeOnOk(); + } + /** * Validate all form fields. * * @return boolean */ - @SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.AvoidDeeplyNestedIfStmts"}) + @SuppressWarnings({ + "PMD.CyclomaticComplexity", + "PMD.AvoidDeeplyNestedIfStmts", + "PMD.CognitiveComplexity" + }) protected boolean validateFormFields() { boolean dialogHasErrors; isValidationErrorShown = dialogHasErrors = false; diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAPluginDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAPluginDialog.java index 7e6cc0dbe..b532c0f70 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAPluginDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAPluginDialog.java @@ -170,7 +170,8 @@ private void fillTargetAreaOptions() { } } - protected void onOK() { + protected void onWriteActionOK() { + if (targetMethod == null) { targetMethod = getSelectedTargetMethod(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAnObserverDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAnObserverDialog.java index 223ecee01..9a25ece3c 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAnObserverDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAnObserverDialog.java @@ -149,7 +149,7 @@ private void fillTargetAreaOptions() { /** * Perform code generation using input data. */ - private void onOK() { + protected void onWriteActionOK() { if (validateFormFields()) { new ObserverClassGenerator(new ObserverFileData( getObserverDirectory(), diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/GatherArrayValuesDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/GatherArrayValuesDialog.java index b27a371be..df2746624 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/GatherArrayValuesDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/GatherArrayValuesDialog.java @@ -114,7 +114,8 @@ public static void open( /** * Fire process if all fields are valid. */ - private void onOK() { + protected void onWriteActionOK() { + if (itemsTable.isEditing()) { itemsTable.getCellEditor().stopCellEditing(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java index c51c5ecca..234550bb9 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java @@ -136,7 +136,8 @@ protected void updateArgumentText() { ); } - protected void onOK() { + protected void onWriteActionOK() { + if (!validateFormFields()) { exit(); return; diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewArgumentInjectionDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewArgumentInjectionDialog.java index 16dab90f7..adc60b35b 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewArgumentInjectionDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewArgumentInjectionDialog.java @@ -363,7 +363,8 @@ public static void open( /** * Fire generation process if all fields are valid. */ - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { final DiArgumentData data = getDialogDataObject(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewBlockDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewBlockDialog.java index 44342993a..3dac3f064 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewBlockDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewBlockDialog.java @@ -111,7 +111,8 @@ public static void open(final Project project, final PsiDirectory directory) { dialog.setVisible(true); } - protected void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFile(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.java index 26a085f41..c2e4c513b 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCLICommandDialog.java @@ -190,7 +190,8 @@ public String getCLICommandClassFqn() { return namespaceBuilder.getClassFqn(); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields() && isPHPClassValid()) { this.generate(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewControllerDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewControllerDialog.java index 402cedb96..79f67c63a 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewControllerDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewControllerDialog.java @@ -198,7 +198,8 @@ public static void open(final Project project, final PsiDirectory directory) { dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFile(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.java index 28ddbd615..37dddae97 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.java @@ -141,7 +141,8 @@ public static void open(final Project project, final PsiDirectory directory) { dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFile(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronjobDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronjobDialog.java index a8f71b0f1..b8080691d 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronjobDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronjobDialog.java @@ -289,7 +289,8 @@ private String suggestCronjobName(final String cronjobClassname) { /** * When new cronjob dialog is filled, validate the input data and generate a new cronjob. */ - private void onOK() { + protected void onWriteActionOK() { + if (!validateFormFields()) { return; } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDataModelDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDataModelDialog.java index 9f1db8128..718a1337c 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDataModelDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDataModelDialog.java @@ -51,7 +51,8 @@ import org.jetbrains.annotations.NotNull; @SuppressWarnings({ - "PMD.ExcessiveImports" + "PMD.ExcessiveImports", + "PMD.ConstructorCallsOverridableMethod" }) public class NewDataModelDialog extends AbstractDialog { @@ -63,13 +64,13 @@ public class NewDataModelDialog extends AbstractDialog { private final Project project; private final String moduleName; - private final ValidatorBundle validatorBundle; - private final CommonBundle commonBundle; + private final transient ValidatorBundle validatorBundle; + private final transient CommonBundle commonBundle; private final List properties; - private JPanel contentPanel; - private JButton buttonOK; - private JButton buttonCancel; + private JPanel contentPanel; //NOPMD + private JButton buttonOK; //NOPMD + private JButton buttonCancel; //NOPMD private JTable propertyTable; private JButton addProperty; private JCheckBox createInterface; @@ -121,7 +122,9 @@ public void windowClosing(final WindowEvent event) { JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); - addComponentListener(new FocusOnAFieldListener(() -> modelName.requestFocusInWindow())); + addComponentListener(new FocusOnAFieldListener(() -> { + modelName.requestFocusInWindow(); + })); } /** @@ -140,7 +143,8 @@ public static void open( /** * Proceed with generation. */ - private void onOK() { + protected void onWriteActionOK() { + if (propertyTable.isEditing()) { propertyTable.getCellEditor().stopCellEditing(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDbSchemaDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDbSchemaDialog.java index 020b17443..fa946e778 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDbSchemaDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewDbSchemaDialog.java @@ -133,7 +133,8 @@ public void windowClosing(final WindowEvent event) { /** * On buttonOK action listener. */ - private void onOK() { + protected void onWriteActionOK() { + if (columnsTable.isEditing()) { columnsTable.getCellEditor().stopCellEditing(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEmailTemplateDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEmailTemplateDialog.java index f2e463ce0..70ba3bdfa 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEmailTemplateDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEmailTemplateDialog.java @@ -212,7 +212,8 @@ private String getModuleName() { return this.moduleName; } - private void onOK() { + protected void onWriteActionOK() { + final boolean emailTemplateCanBeDeclared = !this.validator.validate(this); if (!validateFormFields() || emailTemplateCanBeDeclared) { diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java index 43dc7e6d0..1c78bdb2c 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java @@ -393,7 +393,8 @@ private void generateNewEntityFiles(final @NotNull ActionEvent event) { /** * Perform code generation using input data. */ - private void onOK() { + protected void onWriteActionOK() { + if (!validateFormFields()) { onOkActionFired.setInProgress(false); return; diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewGraphQlResolverDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewGraphQlResolverDialog.java index 83b6080cf..59e2c088b 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewGraphQlResolverDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewGraphQlResolverDialog.java @@ -121,7 +121,8 @@ public static void open(final Project project, final PsiDirectory directory) { } } - protected void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFile(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewInterfaceForServiceDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewInterfaceForServiceDialog.java index 7f4f45ee3..4c7c43314 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewInterfaceForServiceDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewInterfaceForServiceDialog.java @@ -169,7 +169,8 @@ private void fillPredefinedValuesAndDisableInputs() { /** * Fire generation process if all fields are valid. */ - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { final WebApiInterfaceData data = getDialogDataObject(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewLayoutTemplateDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewLayoutTemplateDialog.java index ded318d15..a8c72c375 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewLayoutTemplateDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewLayoutTemplateDialog.java @@ -52,16 +52,25 @@ public class NewLayoutTemplateDialog extends AbstractDialog { private JButton buttonCancel; @FieldValidation(rule = RuleRegistry.NOT_EMPTY, message = {NotEmptyRule.MESSAGE, LAYOUT_NAME}) - @FieldValidation(rule = RuleRegistry.LAYOUT_NAME, message = {IdentifierRule.MESSAGE, LAYOUT_NAME}) + @FieldValidation( + rule = RuleRegistry.LAYOUT_NAME, + message = {IdentifierRule.MESSAGE, LAYOUT_NAME} + ) private JTextField layoutName; private JComboBox area; // labels - private JLabel layoutNameLabel; - private JLabel areaLabel; - private JLabel layoutNameErrorMessage; - + private JLabel layoutNameLabel; //NOPMD + private JLabel areaLabel; //NOPMD + private JLabel layoutNameErrorMessage; //NOPMD + + /** + * Constructs a new dialog for creating a layout templates. + * + * @param project The current IntelliJ project associated with the dialog. + * @param directory The PsiDirectory where the new layout will be created. + */ public NewLayoutTemplateDialog(final Project project, final PsiDirectory directory) { super(); @@ -81,7 +90,7 @@ public NewLayoutTemplateDialog(final Project project, final PsiDirectory directo setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override - public void windowClosing(WindowEvent event) { + public void windowClosing(final WindowEvent event) { onCancel(); } }); @@ -92,10 +101,16 @@ public void windowClosing(WindowEvent event) { JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); - addComponentListener(new FocusOnAFieldListener(() -> area.requestFocusInWindow())); + addComponentListener(new FocusOnAFieldListener(this::run)); autoSelectCurrentArea(); } + /** + * Opens the New Layout Template Dialog, initializes its components. + * + * @param project The current IntelliJ project associated with the dialog. + * @param directory The PsiDirectory where the new layout will be created. + */ public static void open(final Project project, final PsiDirectory directory) { final NewLayoutTemplateDialog dialog = new NewLayoutTemplateDialog(project, directory); dialog.pack(); @@ -103,7 +118,11 @@ public static void open(final Project project, final PsiDirectory directory) { dialog.setVisible(true); } - private void onOK() { + /** + * Handles the action performed when the OK button is clicked in the dialog. + */ + protected void onWriteActionOK() { + if (validateFormFields()) { final String[] layoutNameParts = getLayoutNameParts(); final LayoutXmlData layoutXmlData = new LayoutXmlData( @@ -145,6 +164,9 @@ private void autoSelectCurrentArea() { } } + @SuppressWarnings({ + "PMD.AvoidLiteralsInIfCondition" + }) private String[] getLayoutNameParts() { final String[] layoutNameParts = layoutName.getText().trim().split("_"); String routeName = ""; @@ -170,4 +192,8 @@ private String[] getLayoutNameParts() { private String getArea() { return area.getSelectedItem().toString(); } + + private void run() { + area.requestFocusInWindow(); + } } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewMessageQueueDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewMessageQueueDialog.java index a309b58c2..d2d651989 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewMessageQueueDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewMessageQueueDialog.java @@ -255,7 +255,8 @@ public static void open( dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateCommunication(); generateConsumer(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModelsDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModelsDialog.java index 6157b0a21..b4f41c25c 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModelsDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModelsDialog.java @@ -172,7 +172,8 @@ public static void open( /** * Process generation. */ - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateModelFile(); generateResourceModelFile(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModuleDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModuleDialog.java index 729d2d0c8..1ed2bd046 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModuleDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewModuleDialog.java @@ -178,7 +178,8 @@ private void detectPackageName(final @NotNull PsiDirectory initialBaseDir) { } } - protected void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFiles(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewObserverDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewObserverDialog.java index b1017e2d0..533e6ef30 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewObserverDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewObserverDialog.java @@ -198,7 +198,8 @@ public String getDirectoryStructure() { return directoryStructure.getText().trim(); } - protected void onOK() { + protected void onWriteActionOK() { + if (validateFields()) { PsiDirectory observerDirectory = baseDir; diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewSetupDataPatchDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewSetupDataPatchDialog.java index babceb891..4c751cc7e 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewSetupDataPatchDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewSetupDataPatchDialog.java @@ -27,6 +27,9 @@ import javax.swing.JTextField; import javax.swing.KeyStroke; +@SuppressWarnings({ + "PMD.ConstructorCallsOverridableMethod" +}) public class NewSetupDataPatchDialog extends AbstractDialog { private static final String CLASS_NAME = "Class Name"; @@ -36,25 +39,30 @@ public class NewSetupDataPatchDialog extends AbstractDialog { private final String moduleName; private final String modulePackage; - private JPanel contentPanel; - private JButton buttonOK; - private JButton buttonCancel; + private JPanel contentPanel; //NOPMD + private JButton buttonOK; //NOPMD + private JButton buttonCancel; //NOPMD @FieldValidation(rule = RuleRegistry.NOT_EMPTY, message = {NotEmptyRule.MESSAGE, CLASS_NAME}) @FieldValidation(rule = RuleRegistry.PHP_CLASS, message = {PhpClassRule.MESSAGE, CLASS_NAME}) private JTextField className; - private JLabel classNameLabel; - private JLabel classNameErrorMessage; + private JLabel classNameLabel; //NOPMD + private JLabel classNameErrorMessage; //NOPMD /** - * Constructor + * Constructs a new instance of the NewSetupDataPatchDialog. + * + * @param project The current IntelliJ IDEA project context. + * @param directory The base directory where the Setup Data Patch will be created. + * @param modulePackage The package name of the target Magento 2 module. + * @param moduleName The name of the target Magento 2 module. */ public NewSetupDataPatchDialog( - Project project, - PsiDirectory directory, - String modulePackage, - String moduleName + final Project project, + final PsiDirectory directory, + final String modulePackage, + final String moduleName ) { super(); @@ -75,7 +83,7 @@ public NewSetupDataPatchDialog( setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override - public void windowClosing(WindowEvent event) { + public void windowClosing(final WindowEvent event) { onCancel(); } }); @@ -87,19 +95,21 @@ public void windowClosing(WindowEvent event) { JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); - addComponentListener(new FocusOnAFieldListener(() -> className.requestFocusInWindow())); + addComponentListener(new FocusOnAFieldListener(() -> { + className.requestFocusInWindow(); + })); } /** - * Open dialog + * Open dialog. */ public static void open( - Project project, - PsiDirectory directory, - String modulePackage, - String moduleName + final Project project, + final PsiDirectory directory, + final String modulePackage, + final String moduleName ) { - NewSetupDataPatchDialog dialog = new NewSetupDataPatchDialog( + final NewSetupDataPatchDialog dialog = new NewSetupDataPatchDialog( project, directory, modulePackage, @@ -113,7 +123,8 @@ public static void open( /** * Fire generation process if all fields are valid. */ - protected void onOK() { + protected void onWriteActionOK() { + if (validateFields()) { generateFile(); exit(); @@ -121,13 +132,13 @@ protected void onOK() { } private void generateFile() { - PsiDirectory directory = DirectoryGenerator.getInstance().findOrCreateSubdirectories( + final PsiDirectory directory = DirectoryGenerator.getInstance().findOrCreateSubdirectories( baseDir, NewSetupDataPatchAction.PATCH_DIRECTORY + "/" + NewSetupDataPatchAction.DATA_DIRECTORY ); - ModuleSetupDataPatchGenerator generator = new ModuleSetupDataPatchGenerator( + final ModuleSetupDataPatchGenerator generator = new ModuleSetupDataPatchGenerator( new ModuleSetupDataPatchData( modulePackage, moduleName, @@ -145,7 +156,7 @@ public String getClassName() { } private boolean validateFields() { - PsiDirectory patchDirectory = baseDir + final PsiDirectory patchDirectory = baseDir .findSubdirectory(NewSetupDataPatchAction.PATCH_DIRECTORY); PsiDirectory directory = null; @@ -154,8 +165,8 @@ private boolean validateFields() { } if (directory != null) { - for (PsiFile file : directory.getFiles()) { - String className = ModuleSetupDataPatchFile + for (final PsiFile file : directory.getFiles()) { + final String className = ModuleSetupDataPatchFile .resolveClassNameFromInput(getClassName()); if (file.getName().equals(className + ModuleSetupDataPatchFile.EXTENSION)) { diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentFormDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentFormDialog.java index ed9d470fd..5417a00e7 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentFormDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentFormDialog.java @@ -423,7 +423,8 @@ public static void open( dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { + if (formButtons.isEditing()) { formButtons.getCellEditor().stopCellEditing(); } diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentGridDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentGridDialog.java index b8e568bfd..568870bc9 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentGridDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewUiComponentGridDialog.java @@ -321,7 +321,8 @@ protected void onCancel() { dispose(); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateViewControllerFile(); generateLayoutFile(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.java index 283004fa2..02c0e3365 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewViewModelDialog.java @@ -120,7 +120,8 @@ public static void open(final Project project, final PsiDirectory directory) { dialog.setVisible(true); } - protected void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { generateFile(); exit(); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewWebApiDeclarationDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewWebApiDeclarationDialog.java index 84a361ae4..6544a8fa5 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewWebApiDeclarationDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/NewWebApiDeclarationDialog.java @@ -140,7 +140,8 @@ public static void open( /** * Fire generation process if all fields are valid. */ - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { new WebApiDeclarationGenerator( getDialogDataObject(), diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideClassByAPreferenceDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideClassByAPreferenceDialog.java index 451e91ea9..157f3b65a 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideClassByAPreferenceDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideClassByAPreferenceDialog.java @@ -166,7 +166,8 @@ private void fillTargetAreaOptions() { } } - protected void onOK() { + protected void onWriteActionOK() { + if (!validateFormFields()) { exit(); return; diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideLayoutInThemeDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideLayoutInThemeDialog.java index 727f1363d..9144a0d5e 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideLayoutInThemeDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideLayoutInThemeDialog.java @@ -107,7 +107,7 @@ public static void open(final @NotNull Project project, final @NotNull PsiFile p dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { if (validateFormFields()) { final OverrideLayoutInThemeGenerator overrideLayoutInThemeGenerator = new OverrideLayoutInThemeGenerator(project); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideTemplateInThemeDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideTemplateInThemeDialog.java index a0dde4de8..2a178b668 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideTemplateInThemeDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/OverrideTemplateInThemeDialog.java @@ -110,7 +110,8 @@ public static void open(final @NotNull Project project, final @NotNull PsiFile p dialog.setVisible(true); } - private void onOK() { + protected void onWriteActionOK() { + if (validateFormFields()) { final OverrideTemplateInThemeGenerator overrideInThemeGenerator = new OverrideTemplateInThemeGenerator(project); diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/eavattribute/EavAttributeDialog.java b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/eavattribute/EavAttributeDialog.java index e4cdef48b..a9711b5f5 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/eavattribute/EavAttributeDialog.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/generation/dialog/eavattribute/EavAttributeDialog.java @@ -248,14 +248,15 @@ protected Map> getColumnsSources() { } protected void addActionListenersForOkButton(final JButton okButton) { - okButton.addActionListener(e -> onOk()); + okButton.addActionListener(e -> onOK()); } protected void addActionListenersForOkCancel(final JButton cancelButton) { cancelButton.addActionListener(e -> onCancel()); } - protected void onOk() { + protected void onWriteActionOK() { + stopOptionsTableEditing(getOptionsTable()); if (!validateFormFields()) { diff --git a/src/main/java/com/magento/idea/magento2plugin/actions/groups/NewModuleFileGroup.java b/src/main/java/com/magento/idea/magento2plugin/actions/groups/NewModuleFileGroup.java index ac7ab20b8..99fdd5f9c 100644 --- a/src/main/java/com/magento/idea/magento2plugin/actions/groups/NewModuleFileGroup.java +++ b/src/main/java/com/magento/idea/magento2plugin/actions/groups/NewModuleFileGroup.java @@ -10,14 +10,17 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.IconLoader; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiElement; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.util.indexing.FileBasedIndex; import com.magento.idea.magento2plugin.MagentoIcons; import com.magento.idea.magento2plugin.actions.generation.util.IsClickedDirectoryInsideProject; -import com.magento.idea.magento2plugin.indexes.ModuleIndex; import com.magento.idea.magento2plugin.project.Settings; -import com.magento.idea.magento2plugin.util.magento.GetMagentoModuleUtil; -import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil; +import com.magento.idea.magento2plugin.stubs.indexes.ModuleNameIndex; +import java.util.Collection; +import org.jetbrains.annotations.Nullable; public class NewModuleFileGroup extends NonTrivialActionGroup { @@ -50,20 +53,50 @@ public void update(final AnActionEvent event) { return; } - final String moduleName = GetModuleNameByDirectoryUtil - .execute((PsiDirectory) psiElement, project); + // Skip processing if the IDE is in dumb mode + if (com.intellij.openapi.project.DumbService.isDumb(project)) { + event.getPresentation().setVisible(false); + return; + } + final VirtualFile psiDirectoryVirtualFile = ((PsiDirectory) psiElement).getVirtualFile(); + final String moduleName = getModuleName(project, psiDirectoryVirtualFile); if (moduleName != null) { - final PsiDirectory moduleDirectory = new ModuleIndex(project) - .getModuleDirectoryByModuleName(moduleName); - - if (moduleDirectory != null - && GetMagentoModuleUtil.isDirectoryInEditableModule(moduleDirectory)) { - event.getPresentation().setVisible(true); - return; - } + event.getPresentation().setVisible(true); + return; } event.getPresentation().setVisible(false); } + + /** + * Retrieves the module name associated with a given directory within a project. + * + * @param project the project within which the module search is performed + * @param psiDirectoryVirtualFile the virtual file representing the directory being checked + */ + private static @Nullable String getModuleName( + final Project project, + final VirtualFile psiDirectoryVirtualFile + ) { + String moduleName = null; + final FileBasedIndex index = FileBasedIndex.getInstance(); + for (final String entry : index.getAllKeys(ModuleNameIndex.KEY, project)) { + final Collection moduleVfs = index.getContainingFiles( + ModuleNameIndex.KEY, entry, GlobalSearchScope.projectScope(project) + ); + + for (final VirtualFile moduleFile : moduleVfs) { + if (moduleFile.getParent().getPath().equals(psiDirectoryVirtualFile.getPath())) { + moduleName = entry; + break; + } + } + + if (moduleName != null) { + break; + } + } + return moduleName; + } } diff --git a/src/main/java/com/magento/idea/magento2plugin/generation/php/MagentoModuleGenerator.java b/src/main/java/com/magento/idea/magento2plugin/generation/php/MagentoModuleGenerator.java index b6c9d669b..9dfe5796d 100644 --- a/src/main/java/com/magento/idea/magento2plugin/generation/php/MagentoModuleGenerator.java +++ b/src/main/java/com/magento/idea/magento2plugin/generation/php/MagentoModuleGenerator.java @@ -15,7 +15,6 @@ import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; -import com.intellij.util.PlatformUtils; import com.magento.idea.magento2plugin.MagentoIcons; import com.magento.idea.magento2plugin.actions.generation.data.ModuleComposerJsonData; import com.magento.idea.magento2plugin.actions.generation.data.ModuleRegistrationPhpData; @@ -57,11 +56,6 @@ public ProjectGeneratorPeer createPeer() { return new MagentoProjectPeer(); } - @Override - public boolean isPrimaryGenerator() { - return PlatformUtils.isPhpStorm(); - } - /** * Generate project. * diff --git a/src/main/java/com/magento/idea/magento2plugin/generation/php/NewModuleForm.java b/src/main/java/com/magento/idea/magento2plugin/generation/php/NewModuleForm.java index b247d3dfa..9148328aa 100644 --- a/src/main/java/com/magento/idea/magento2plugin/generation/php/NewModuleForm.java +++ b/src/main/java/com/magento/idea/magento2plugin/generation/php/NewModuleForm.java @@ -79,8 +79,6 @@ private void addPathListener() { FileChooserDescriptorFactory.createSingleFolderDescriptor(); final ComponentWithBrowseButton.BrowseFolderActionListener browseFolderListener = new ComponentWithBrowseButton.BrowseFolderActionListener( - "Magento Root Directory", - "Choose Magento root directory", this.magentoPath, null, descriptor, diff --git a/src/main/java/com/magento/idea/magento2plugin/indexes/ModuleIndex.java b/src/main/java/com/magento/idea/magento2plugin/indexes/ModuleIndex.java index f71d648c5..f3dfe5021 100644 --- a/src/main/java/com/magento/idea/magento2plugin/indexes/ModuleIndex.java +++ b/src/main/java/com/magento/idea/magento2plugin/indexes/ModuleIndex.java @@ -12,7 +12,6 @@ import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiManager; import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.util.SlowOperations; import com.intellij.util.indexing.FileBasedIndex; import com.jetbrains.php.lang.PhpFileType; import com.magento.idea.magento2plugin.magento.packages.Package; @@ -126,20 +125,15 @@ private List getNames( } final FileBasedIndex index = FileBasedIndex .getInstance(); - final Collection files = new ArrayList<>(); - - SlowOperations.allowSlowOperations(() -> { - files.addAll( - index.getContainingFiles( - ModuleNameIndex.KEY, - moduleName, - GlobalSearchScope.getScopeRestrictedByFileTypes( - GlobalSearchScope.allScope(project), - PhpFileType.INSTANCE - ) - ) - ); - }); + + final Collection files = new ArrayList<>(index.getContainingFiles( + ModuleNameIndex.KEY, + moduleName, + GlobalSearchScope.getScopeRestrictedByFileTypes( + GlobalSearchScope.allScope(project), + PhpFileType.INSTANCE + ) + )); if (files.isEmpty()) { return null; diff --git a/src/main/java/com/magento/idea/magento2plugin/inspections/php/util/PhpClassImplementsNoninterceptableInterfaceUtil.java b/src/main/java/com/magento/idea/magento2plugin/inspections/php/util/PhpClassImplementsNoninterceptableInterfaceUtil.java index 1f611196d..8d7360966 100644 --- a/src/main/java/com/magento/idea/magento2plugin/inspections/php/util/PhpClassImplementsNoninterceptableInterfaceUtil.java +++ b/src/main/java/com/magento/idea/magento2plugin/inspections/php/util/PhpClassImplementsNoninterceptableInterfaceUtil.java @@ -5,7 +5,6 @@ package com.magento.idea.magento2plugin.inspections.php.util; -import com.intellij.util.SlowOperations; import com.jetbrains.php.lang.psi.elements.PhpClass; import com.magento.idea.magento2plugin.magento.files.Plugin; import org.jetbrains.annotations.NotNull; @@ -22,9 +21,7 @@ private PhpClassImplementsNoninterceptableInterfaceUtil() {} * @return bool */ public static boolean execute(final @NotNull PhpClass phpClass) { - final PhpClass[] interfaces = SlowOperations.allowSlowOperations( - phpClass::getImplementedInterfaces - ); + final PhpClass[] interfaces = phpClass.getImplementedInterfaces(); if (interfaces.length == 0) { return false; diff --git a/src/main/java/com/magento/idea/magento2plugin/project/ProjectDetector.java b/src/main/java/com/magento/idea/magento2plugin/project/ProjectDetector.java index c80f5f1a9..a572d1adf 100644 --- a/src/main/java/com/magento/idea/magento2plugin/project/ProjectDetector.java +++ b/src/main/java/com/magento/idea/magento2plugin/project/ProjectDetector.java @@ -6,6 +6,7 @@ package com.magento.idea.magento2plugin.project; import com.intellij.notification.Notification; +import com.intellij.notification.NotificationGroupManager; import com.intellij.notification.NotificationListener; import com.intellij.notification.NotificationType; import com.intellij.notification.Notifications; @@ -36,9 +37,13 @@ public void configureProject( if (!MagentoBasePathUtil.isMagentoFolderValid(baseDir.getPath())) { return; } - final Notification notification = new Notification("Magento", "Magento", - "Enable Magento support for this project?", - NotificationType.INFORMATION, new NotificationListener.Adapter() { + final Notification notification = NotificationGroupManager.getInstance() + .getNotificationGroup("Magento Notifications") + .createNotification( + "Magento", + "Enable Magento support for this project?", + NotificationType.INFORMATION + ).setListener(new NotificationListener.Adapter() { @Override public void hyperlinkActivated( final @NotNull Notification notification, diff --git a/src/main/java/com/magento/idea/magento2plugin/project/SettingsForm.java b/src/main/java/com/magento/idea/magento2plugin/project/SettingsForm.java index 55f747bf6..eb1d5d33e 100644 --- a/src/main/java/com/magento/idea/magento2plugin/project/SettingsForm.java +++ b/src/main/java/com/magento/idea/magento2plugin/project/SettingsForm.java @@ -195,8 +195,6 @@ private void addPathListener() { FileChooserDescriptorFactory.createSingleFolderDescriptor(); final ComponentWithBrowseButton.BrowseFolderActionListener browseFolderListener = new ComponentWithBrowseButton.BrowseFolderActionListener( - "Magento Root Directory", - "Choose Magento root directory", this.magentoPath, project, descriptor, diff --git a/src/main/java/com/magento/idea/magento2plugin/util/magento/GetMagentoModuleUtil.java b/src/main/java/com/magento/idea/magento2plugin/util/magento/GetMagentoModuleUtil.java index 3c4541f34..e38c30395 100644 --- a/src/main/java/com/magento/idea/magento2plugin/util/magento/GetMagentoModuleUtil.java +++ b/src/main/java/com/magento/idea/magento2plugin/util/magento/GetMagentoModuleUtil.java @@ -10,7 +10,6 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.util.SlowOperations; import com.jetbrains.php.lang.psi.elements.ClassConstantReference; import com.jetbrains.php.lang.psi.elements.MethodReference; import com.jetbrains.php.lang.psi.elements.StringLiteralExpression; @@ -140,9 +139,7 @@ private static PsiFile getModuleRegistrationFile( private static String parseParameterValue(final PsiElement valueHolder) { if (valueHolder instanceof ClassConstantReference) { final ClassConstantReference constantReference = (ClassConstantReference) valueHolder; - final PsiElement resolved = SlowOperations.allowSlowOperations( - constantReference::resolve - ); + final PsiElement resolved = constantReference.resolve(); if (!(resolved instanceof ClassConstImpl)) { return null; diff --git a/src/main/java/com/magento/idea/magento2uct/ui/ConfigurationDialog.java b/src/main/java/com/magento/idea/magento2uct/ui/ConfigurationDialog.java index e9bb8b6a2..94f3fc123 100644 --- a/src/main/java/com/magento/idea/magento2uct/ui/ConfigurationDialog.java +++ b/src/main/java/com/magento/idea/magento2uct/ui/ConfigurationDialog.java @@ -129,7 +129,7 @@ public static void open(final @NotNull Project project) { * Save configuration. */ @SuppressWarnings("PMD.CyclomaticComplexity") - private void onOK() { + protected void onWriteActionOK() { modulePathError.setText(""); additionalPathError.setText(""); diff --git a/src/main/java/com/magento/idea/magento2uct/ui/ReindexDialog.java b/src/main/java/com/magento/idea/magento2uct/ui/ReindexDialog.java index f0f23ab0a..bff6e8507 100644 --- a/src/main/java/com/magento/idea/magento2uct/ui/ReindexDialog.java +++ b/src/main/java/com/magento/idea/magento2uct/ui/ReindexDialog.java @@ -101,7 +101,7 @@ public static void open( /** * Execute reindexing action. */ - private void onOK() { + protected void onWriteActionOK() { if (targetVersion.getSelectedItem() == null || targetIndex.getSelectedItem() == null) { return; } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 6139a9b5e..f802f43ac 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -7,53 +7,11 @@ com.magento.idea.magento2plugin Magento PhpStorm - 2025.0.0 + 2025.0.1 Magento Inc. Main Features -
    -
  • Code Generation: Quickly generate boilerplate Magento code like plugins, observers, XML configurations, and more.
  • -
  • Inspections: Identify and fix potential issues with Magento-specific code quality tools.
  • -
  • Reference Navigation: Easily navigate between Magento files, classes, and references.
  • -
  • Code Completion: Auto-complete Magento-specific code constructs, including XML tags, class names, and methods.
  • -
  • Copy Magento Path: Copy file paths in Magento format.
  • -
  • Upgrade Compatibility Tool: Assist in upgrading Magento modules and code for newer Magento versions.
  • -
  • URN Mapping: Resolve Magento URNs for correct file associations and navigation.
  • -
-

Version 2025.0.0 - Contributors

- - - - - - -
- - Contributor 1 -
- Yevhen Zvieriev -
-
- - Contributor 2 -
- Mykola Silin -
-
- - Contributor 3 -
- Vitalii Boiko -
-
- -

Support the Project

- -If you find this plugin helpful and want to support its development, consider buying the contributors a coffee: -Buy Me a Coffee ]]>