IDEA-77127 Gradle: Support gradle wrapper

1. Correct gradle configurable processing in order to avoid 'modified after creation' situation;
2. Obsolete service is removed from the gradle plugin.xml;
This commit is contained in:
Denis.Zhdanov
2012-12-05 18:31:16 +04:00
parent c22b300ee6
commit b0db55c84f
2 changed files with 10 additions and 6 deletions
-1
View File
@@ -67,7 +67,6 @@
<projectService serviceImplementation="org.jetbrains.plugins.gradle.config.GradleSettings"/>
<projectService serviceImplementation="org.jetbrains.plugins.gradle.config.GradleLocalSettings"/>
<projectService serviceImplementation="org.jetbrains.plugins.gradle.config.GradleProjectState"/>
<toolWindow id="JetGradle" anchor="right" icon="GradleIcons.ToolWindowGradle"
factoryClass="org.jetbrains.plugins.gradle.ui.GradleToolWindowFactory"/>
@@ -348,7 +348,7 @@ public class GradleConfigurable implements SearchableConfigurable, Configurable.
GradleSettings settings = myHelper.getSettings(myProject);
if (!Comparing.equal(myLinkedGradleProjectPathField.getText(), settings.getLinkedProjectPath())) {
if (!Comparing.equal(normalizePath(myLinkedGradleProjectPathField.getText()), normalizePath(settings.getLinkedProjectPath()))) {
return true;
}
@@ -362,16 +362,21 @@ public class GradleConfigurable implements SearchableConfigurable, Configurable.
return true;
}
if (!Comparing.equal(myGradleHomePathField.getText(), settings.getGradleHome())) {
if (myGradleHomeModifiedByUser) {
useNormalColorForPath();
}
if (myGradleHomeModifiedByUser &&
!Comparing.equal(normalizePath(myGradleHomePathField.getText()), normalizePath(settings.getGradleHome())))
{
useNormalColorForPath();
return true;
}
return false;
}
@Nullable
private static String normalizePath(@Nullable String s) {
return StringUtil.isEmpty(s) ? null : s;
}
@Override
public void apply() {
if (myProject == null) {