Skip to content

Commit e3c21ce

Browse files
author
Vitaliy
authored
Merge branch '1.0.0-develop' into code-generation-view-model
2 parents 0af9901 + 3ac6b7a commit e3c21ce

Some content is hidden

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

41 files changed

+1523
-39
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Create a Plugin class for a class public method action
1414
* Code Inspection: Warning regarding Cacheable false attribute in default XML
1515
* Create a Preference for a class action
16+
* Create a Block action
17+
* Line markers for navigation from a plugin class to a target class
1618

1719
0.3.0
1820
=============

resources/META-INF/plugin.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<action id="Magento2NewModule" class="com.magento.idea.magento2plugin.actions.generation.NewModuleAction"/>
6767
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="NewDir"/>
6868
</group>
69+
<action id="MagentoCreateAnObserver.Menu" class="com.magento.idea.magento2plugin.actions.generation.CreateAnObserverAction">
70+
<add-to-group group-id="EditorPopupMenu"/>
71+
</action>
6972
<action id="MagentoCreateAPlugin.Menu" class="com.magento.idea.magento2plugin.actions.generation.CreateAPluginAction">
7073
<add-to-group group-id="EditorPopupMenu"/>
7174
</action>
@@ -110,6 +113,7 @@
110113
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.js.MagentoLibJsIndex" />
111114

112115
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginLineMarkerProvider"/>
116+
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.PluginTargetLineMarkerProvider"/>
113117
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.ClassConfigurationLineMarkerProvider"/>
114118
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.php.linemarker.WebApiLineMarkerProvider"/>
115119

@@ -145,6 +149,8 @@
145149
<internalFileTemplate name="Magento Module DI Xml"/>
146150
<internalFileTemplate name="Magento Php Preference Class"/>
147151
<internalFileTemplate name="Magento Module Common Php Class"/>
152+
<internalFileTemplate name="Magento Observer Class"/>
153+
<internalFileTemplate name="Magento Module Events Xml"/>
148154
</extensions>
149155

150156
</idea-plugin>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<preference for="${FOR}" type="${TYPE}" />
1+
<preference for="${FOR}" type="${TYPE}" />

resources/fileTemplates/code/Magento Module DI Xml Preference.xml.html

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,36 @@
66
-->
77
<html>
88
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td><font face="verdana" size="-1">
12+
The object manager uses abstraction-implementation mappings when the constructor signature of a class requests
13+
an object by its interface. The object manager uses these mappings to determine what the default implementation
14+
is for that class for a particular scope.
15+
</font><br>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td><font face="verdana" size="-1">
20+
If you want to override a public or protected method from a core class, utilize the preference node from di.xml to achieve it.
21+
</font><br>
22+
</td>
23+
</tr>
24+
</table>
25+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
26+
<tr>
27+
<td colspan="3"><font face="verdana" size="-1">Predefined variables will take the following values:</font></td>
28+
</tr>
29+
<tr>
30+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${FOR}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">Target PHP Class to change its concrete implementation</font></td>
33+
</tr>
34+
<tr>
35+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${TYPE}</b></font></nobr></td>
36+
<td width="10">&nbsp;</td>
37+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class that will be instantiated instead of specified in predefined ${FOR} variable</font></td>
38+
</tr>
39+
</table>
940
</body>
10-
</html>
41+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<event name="${EVENT_NAME}">
2+
<observer name="${OBSERVER_NAME}" instance="${OBSERVER_CLASS}" />
3+
</event>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Observer for ${EVENT_NAME}
3+
*
4+
* @param Observer $observer
5+
* @return void
6+
*/
7+
public function execute(Observer $observer)
8+
{
9+
$event = $observer->getEvent();
10+
// TODO: Implement observer method.
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
3+
</config>

resources/fileTemplates/internal/Magento Module Xml.xml.ft

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
33
#if (${SEQUENCES})
44
<module name="${PACKAGE}_${MODULE_NAME}">
5-
${SEQUENCES}
5+
<sequence>
6+
${SEQUENCES}
7+
</sequence>
68
</module>
79
#else
810
<module name="${PACKAGE}_${MODULE_NAME}" />

0 commit comments

Comments
 (0)