diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConfigureNotification.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConfigureNotification.java index e9ab43b4cc6e..18b554c4eabd 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConfigureNotification.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConfigureNotification.java @@ -17,7 +17,6 @@ package org.jetbrains.plugins.groovy.mvc; import com.intellij.openapi.module.Module; import com.intellij.openapi.roots.ui.configuration.libraries.AddCustomLibraryDialog; -import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.EditorNotificationPanel; import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.annotator.GroovyFrameworkConfigNotification; @@ -36,10 +35,7 @@ public class MvcConfigureNotification extends GroovyFrameworkConfigNotification @Override public boolean hasFrameworkStructure(@NotNull Module module) { - VirtualFile appDir = framework.findAppDirectory(module); - if (appDir == null) return false; - - return appDir.findChild("controllers") != null && appDir.findChild("conf") != null; + return framework.hasFrameworkStructure(module); } @Override @@ -59,7 +55,7 @@ public class MvcConfigureNotification extends GroovyFrameworkConfigNotification @Override public EditorNotificationPanel createConfigureNotificationPanel(@NotNull final Module module) { final EditorNotificationPanel panel = new EditorNotificationPanel(); - panel.setText(framework.getFrameworkName() + " SDK is not configured for module '"+ module.getName() + '\''); + panel.setText(framework.getFrameworkName() + " SDK is not configured for module '" + module.getName() + '\''); panel.createActionLabel("Configure " + framework.getFrameworkName() + " SDK", new Runnable() { @Override public void run() { @@ -69,5 +65,4 @@ public class MvcConfigureNotification extends GroovyFrameworkConfigNotification return panel; } - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java index a714700d97e0..1ec30d6e9fb1 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java @@ -90,6 +90,13 @@ public abstract class MvcFramework { return new GroovyLibraryDescription(getSdkHomePropertyName(), getLibraryKind(), getDisplayName()); } + public boolean hasFrameworkStructure(@NotNull Module module) { + VirtualFile appDir = findAppDirectory(module); + if (appDir == null) return false; + + return appDir.findChild("controllers") != null && appDir.findChild("conf") != null; + } + public boolean hasFrameworkJar(@NotNull Module module) { GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, false); return JavaPsiFacade.getInstance(module.getProject()).findClass(getSomeFrameworkClass(), scope) != null; @@ -641,5 +648,4 @@ public abstract class MvcFramework { } return null; } - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcProjectWithoutLibraryNotificator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcProjectWithoutLibraryNotificator.java index 8871a43f4086..d0bb2a0fbc4d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcProjectWithoutLibraryNotificator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcProjectWithoutLibraryNotificator.java @@ -27,7 +27,6 @@ import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.startup.StartupActivity; import com.intellij.openapi.util.Pair; -import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -82,11 +81,8 @@ public class MvcProjectWithoutLibraryNotificator implements StartupActivity, Dum for (Module module : ModuleManager.getInstance(project).getModules()) { for (MvcFramework framework : frameworks) { - VirtualFile appRoot = framework.findAppRoot(module); - if (appRoot != null && appRoot.findChild("application.properties") != null) { - if (!framework.hasFrameworkJar(module)) { - return Pair.create(module, framework); - } + if (framework.hasFrameworkStructure(module) && !framework.hasFrameworkJar(module)) { + return Pair.create(module, framework); } } }