Skip to content

Commit cbd56b2

Browse files
dkvashninbaylenaorobei
authored andcommitted
Added new version description
(cherry picked from commit 419a45b)
1 parent b0862b5 commit cbd56b2

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

META-INF/plugin.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin version="2">
22
<id>com.magento.idea.magento2plugin</id>
33
<name>Magento2</name>
4-
<version>0.1</version>
4+
<version>0.2.0</version>
55
<vendor email="[email protected]" url="https://github.com/dkvashninbay/magento2plugin">Dmytro Kvashnin</vendor>
66

77
<description><![CDATA[
@@ -32,6 +32,13 @@
3232
]]></description>
3333

3434
<change-notes><![CDATA[
35+
<h3>0.2.0</h3>
36+
<ul>
37+
<li>WebApi routes</li>
38+
<li>nicer "Goto configuration" labels</li>
39+
<li>plugin settings (manual reindex, URN generation, plugin on/off)</li>
40+
</ul>
41+
3542
<h3>0.1</h3>
3643
<ul>
3744
<li>Context type completion for:<br/>

src/com/magento/idea/magento2plugin/SettingsForm.form

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
4848
</constraints>
4949
<properties>
50-
<text value="Enable Plugin for this Project (change requires reindex -&gt;)"/>
50+
<selected value="false"/>
51+
<text value="Enable Plugin for this Project"/>
5152
</properties>
5253
</component>
5354
<component id="47a96" class="javax.swing.JButton" binding="buttonReindex">

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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.magento.idea.magento2plugin;
22

33
import com.intellij.javaee.ExternalResourceManager;
4+
import com.intellij.javaee.ExternalResourceManagerEx;
45
import com.intellij.openapi.application.ApplicationManager;
56
import com.intellij.openapi.options.Configurable;
67
import com.intellij.openapi.options.ConfigurationException;
@@ -59,8 +60,7 @@ public JComponent createComponent() {
5960
new MouseAdapter() {
6061
@Override
6162
public void mouseClicked(MouseEvent e) {
62-
IndexUtil.manualReindex();
63-
MagentoComponentManager.getInstance(project).flushModules();
63+
reindex();
6464
super.mouseClicked(e);
6565
}
6666
}
@@ -75,6 +75,11 @@ public void mouseClicked(MouseEvent e) {
7575
return (JComponent) panel1;
7676
}
7777

78+
private void reindex() {
79+
IndexUtil.manualReindex();
80+
MagentoComponentManager.getInstance(project).flushModules();
81+
}
82+
7883
@Override
7984
public boolean isModified() {
8085
return !pluginEnabled.isSelected() == getSettings().pluginEnabled;
@@ -85,6 +90,11 @@ public void apply() throws ConfigurationException {
8590
getSettings().pluginEnabled = pluginEnabled.isSelected();
8691
buttonReindex.setEnabled(getSettings().pluginEnabled);
8792
regenerateUrnMapButton.setEnabled(getSettings().pluginEnabled);
93+
94+
if (buttonReindex.isEnabled()) {
95+
reindex();
96+
}
97+
8898
}
8999

90100
@Override
@@ -141,7 +151,15 @@ public void run() {
141151
continue;
142152
}
143153

144-
externalResourceManager.addResource(urnKey, virtualFile.getCanonicalPath());
154+
// we need to attach resource to a project scope
155+
// but with ExternalResourceManager itself it's not possible unfortunately
156+
if (externalResourceManager instanceof ExternalResourceManagerEx) {
157+
((ExternalResourceManagerEx)externalResourceManager).addResource(
158+
urnKey, virtualFile.getCanonicalPath(), project
159+
);
160+
} else {
161+
externalResourceManager.addResource(urnKey, virtualFile.getCanonicalPath());
162+
}
145163
}
146164
}
147165
}

0 commit comments

Comments
 (0)