Skip to content

Commit a284fcf

Browse files
author
Vitaliy Boyko
committed
Adjusted Magento version resolving and refactoring
1 parent dc0d014 commit a284fcf

File tree

60 files changed

+311
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+311
-233
lines changed

resources/META-INF/plugin.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
</actions>
8181

8282
<extensions defaultExtensionNs="com.intellij">
83-
<directoryProjectGenerator implementation="com.magento.idea.magento2plugin.generation.MagentoModuleGenerator"/>
84-
<projectTemplatesFactory implementation="com.magento.idea.magento2plugin.generation.MagentoTemplatesFactory"/>
83+
<directoryProjectGenerator implementation="com.magento.idea.magento2plugin.generation.php.MagentoModuleGenerator"/>
84+
<projectTemplatesFactory implementation="com.magento.idea.magento2plugin.generation.php.MagentoTemplatesFactory"/>
8585

8686
<projectService serviceImplementation="com.magento.idea.magento2plugin.project.Settings"/>
8787

@@ -109,10 +109,10 @@
109109
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.js.RequireJsIndex" />
110110
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.js.MagentoLibJsIndex" />
111111

112-
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginLineMarkerProvider"/>
113-
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginTargetLineMarkerProvider"/>
114-
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.ClassConfigurationLineMarkerProvider"/>
115-
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.WebApiLineMarkerProvider"/>
112+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.PluginLineMarkerProvider"/>
113+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.PluginTargetLineMarkerProvider"/>
114+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.ClassConfigurationLineMarkerProvider"/>
115+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.WebApiLineMarkerProvider"/>
116116

117117
<directoryProjectConfigurator implementation="com.magento.idea.magento2plugin.project.ProjectDetector"/>
118118

resources/META-INF/withJsGraphQl.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<idea-plugin>
22
<extensions defaultExtensionNs="com.intellij">
33
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.graphql.GraphQlResolverIndex" />
4-
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.GraphQlResolverUsageLineMarkerProvider"/>
5-
<codeInsight.lineMarkerProvider language="GraphQL" implementationClass="com.magento.idea.magento2plugin.graphql.linemarker.GraphQlResolverClassLineMarkerProvider"/>
4+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.GraphQlResolverUsageLineMarkerProvider"/>
5+
<codeInsight.lineMarkerProvider language="GraphQL" implementationClass="com.magento.idea.magento2plugin.linemarker.graphql.GraphQlResolverClassLineMarkerProvider"/>
66
<localInspection language="PHP" groupPath="PHP"
77
shortName="GraphQlResolverInspection" displayName="Graphql must implements ResolverInterface"
88
groupName="Magento 2"

resources/magento2/validation.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ validator.module.noSuchModule=No such module {0}
99
validator.file.alreadyExists={0} already exists
1010
validator.file.cantBeCreated={0} can't be created
1111
validator.class.alreadyDeclared={0} already declared in the target module
12+
validator.magentoVersionInvalid=Please specify valid Magento version or use 'any' keyword as default

src/com/magento/idea/magento2plugin/MagentoIcons.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
package com.magento.idea.magento2plugin;
66

77
import com.intellij.openapi.util.IconLoader;
8-
98
import javax.swing.*;
109

11-
/**
12-
* Created by dkvashnin on 11/14/15.
13-
*/
1410
public class MagentoIcons {
15-
public static final Icon WEB_API = IconLoader.getIcon("icons/webapi.png");
11+
public static final Icon WEB_API = IconLoader.getIcon("/icons/webapi.png");
1612
public static final Icon MODULE = IconLoader.getIcon("/icons/module.png");
1713
}

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/CreateAPluginDialogValidator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.intellij.openapi.project.Project;
88
import com.magento.idea.magento2plugin.actions.generation.dialog.CreateAPluginDialog;
99
import com.magento.idea.magento2plugin.indexes.ModuleIndex;
10-
import com.magento.idea.magento2plugin.util.Regex;
10+
import com.magento.idea.magento2plugin.util.RegExUtil;
1111
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1212
import javax.swing.*;
1313
import java.util.List;
@@ -42,7 +42,7 @@ public boolean validate(Project project)
4242
return false;
4343
}
4444

45-
if (!pluginClassName.matches(Regex.ALPHANUMERIC)) {
45+
if (!pluginClassName.matches(RegExUtil.ALPHANUMERIC)) {
4646
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "Plugin Class Name");
4747
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4848

@@ -64,7 +64,7 @@ public boolean validate(Project project)
6464
return false;
6565
}
6666

67-
if (!pluginDirectory.matches(Regex.DIRECTORY)) {
67+
if (!pluginDirectory.matches(RegExUtil.DIRECTORY)) {
6868
String errorMessage = validatorBundle.message("validator.directory.isNotValid", "Plugin Directory");
6969
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
7070

@@ -79,7 +79,7 @@ public boolean validate(Project project)
7979
return false;
8080
}
8181

82-
if (!pluginName.matches(Regex.IDENTIFIER)) {
82+
if (!pluginName.matches(RegExUtil.IDENTIFIER)) {
8383
String errorMessage = validatorBundle.message("validator.identifier", "Plugin Name");
8484
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
8585

@@ -94,7 +94,7 @@ public boolean validate(Project project)
9494
return false;
9595
}
9696

97-
if (!sortOrder.matches(Regex.NUMERIC)) {
97+
if (!sortOrder.matches(RegExUtil.NUMERIC)) {
9898
String errorMessage = validatorBundle.message("validator.onlyNumbers", "Sort Order");
9999
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
100100

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/CreateAnObserverDialogValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.intellij.openapi.project.Project;
88
import com.magento.idea.magento2plugin.actions.generation.dialog.CreateAnObserverDialog;
99
import com.magento.idea.magento2plugin.indexes.ModuleIndex;
10-
import com.magento.idea.magento2plugin.util.Regex;
10+
import com.magento.idea.magento2plugin.util.RegExUtil;
1111
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1212
import javax.swing.*;
1313
import java.util.List;
@@ -40,7 +40,7 @@ public boolean validate(Project project)
4040
return false;
4141
}
4242

43-
if (!observerClassName.matches(Regex.ALPHANUMERIC)) {
43+
if (!observerClassName.matches(RegExUtil.ALPHANUMERIC)) {
4444
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "Observer Class Name");
4545
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4646

@@ -63,7 +63,7 @@ public boolean validate(Project project)
6363
return false;
6464
}
6565

66-
if (!observerDirectory.matches(Regex.DIRECTORY)) {
66+
if (!observerDirectory.matches(RegExUtil.DIRECTORY)) {
6767
String errorMessage = validatorBundle.message("validator.directory.isNotValid", "Observer Directory");
6868
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
6969

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/NewBlockValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package com.magento.idea.magento2plugin.actions.generation.dialog.validator;
66

77
import com.magento.idea.magento2plugin.actions.generation.dialog.NewBlockDialog;
8-
import com.magento.idea.magento2plugin.util.Regex;
8+
import com.magento.idea.magento2plugin.util.RegExUtil;
99
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1010
import javax.swing.*;
1111

@@ -38,7 +38,7 @@ public boolean validate()
3838
return false;
3939
}
4040

41-
if (!moduleName.matches(Regex.ALPHANUMERIC)) {
41+
if (!moduleName.matches(RegExUtil.ALPHANUMERIC)) {
4242
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "Block Name");
4343
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4444

@@ -60,7 +60,7 @@ public boolean validate()
6060
return false;
6161
}
6262

63-
if (!pluginDirectory.matches(Regex.DIRECTORY)) {
63+
if (!pluginDirectory.matches(RegExUtil.DIRECTORY)) {
6464
String errorMessage = validatorBundle.message("validator.directory.isNotValid", "Block Directory");
6565
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
6666

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/NewGraphQlResolverValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package com.magento.idea.magento2plugin.actions.generation.dialog.validator;
66

77
import com.magento.idea.magento2plugin.actions.generation.dialog.NewGraphQlResolverDialog;
8-
import com.magento.idea.magento2plugin.util.Regex;
8+
import com.magento.idea.magento2plugin.util.RegExUtil;
99
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1010

1111
import javax.swing.*;
@@ -39,7 +39,7 @@ public boolean validate()
3939
return false;
4040
}
4141

42-
if (!resolverClassName.matches(Regex.ALPHANUMERIC)) {
42+
if (!resolverClassName.matches(RegExUtil.ALPHANUMERIC)) {
4343
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "GraphQL Resolver Name");
4444
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4545

@@ -61,7 +61,7 @@ public boolean validate()
6161
return false;
6262
}
6363

64-
if (!graphQlResolverDirectory.matches(Regex.DIRECTORY)) {
64+
if (!graphQlResolverDirectory.matches(RegExUtil.DIRECTORY)) {
6565
String errorMessage = validatorBundle.message("validator.directory.isNotValid", "GraphQL Resolver Directory");
6666
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
6767

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/NewModuleDialogValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import com.magento.idea.magento2plugin.actions.generation.dialog.NewModuleDialog;
88
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
9-
import com.magento.idea.magento2plugin.util.Regex;
9+
import com.magento.idea.magento2plugin.util.RegExUtil;
1010
import javax.swing.*;
1111

1212
public class NewModuleDialogValidator {
@@ -37,7 +37,7 @@ public boolean validate()
3737
return false;
3838
}
3939

40-
if (!packageName.matches(Regex.ALPHANUMERIC)) {
40+
if (!packageName.matches(RegExUtil.ALPHANUMERIC)) {
4141
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "Package Name");
4242
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4343

@@ -59,7 +59,7 @@ public boolean validate()
5959
return false;
6060
}
6161

62-
if (!moduleName.matches(Regex.ALPHANUMERIC)) {
62+
if (!moduleName.matches(RegExUtil.ALPHANUMERIC)) {
6363
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "Module Name");
6464
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
6565

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/NewViewModelValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package com.magento.idea.magento2plugin.actions.generation.dialog.validator;
66

77
import com.magento.idea.magento2plugin.actions.generation.dialog.NewViewModelDialog;
8-
import com.magento.idea.magento2plugin.util.Regex;
8+
import com.magento.idea.magento2plugin.util.RegExUtil;
99
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1010

1111
import javax.swing.*;
@@ -39,7 +39,7 @@ public boolean validate()
3939
return false;
4040
}
4141

42-
if (!moduleName.matches(Regex.ALPHANUMERIC)) {
42+
if (!moduleName.matches(RegExUtil.ALPHANUMERIC)) {
4343
String errorMessage = validatorBundle.message("validator.alphaNumericCharacters", "View Model Name");
4444
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
4545

@@ -61,7 +61,7 @@ public boolean validate()
6161
return false;
6262
}
6363

64-
if (!pluginDirectory.matches(Regex.DIRECTORY)) {
64+
if (!pluginDirectory.matches(RegExUtil.DIRECTORY)) {
6565
String errorMessage = validatorBundle.message("validator.directory.isNotValid", "View Model Directory");
6666
JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.ERROR_MESSAGE);
6767

0 commit comments

Comments
 (0)