From 6c0021cc67941e0fd807737eaef2a4b0a6447e2c Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 18 Jan 2012 17:14:17 +0400 Subject: [PATCH] groupPath configured in XML --- .../intellij/codeInspection/InspectionEP.java | 18 +- .../ex/InspectionToolWrapper.java | 2 +- .../src/messages/InspectionsBundle.properties | 2 +- plugins/groovy/src/META-INF/plugin.xml | 220 +++++++++--------- plugins/java-i18n/src/META-INF/plugin.xml | 2 +- 5 files changed, 129 insertions(+), 115 deletions(-) diff --git a/platform/lang-api/src/com/intellij/codeInspection/InspectionEP.java b/platform/lang-api/src/com/intellij/codeInspection/InspectionEP.java index 211bca3c0b9c..e802892bc578 100644 --- a/platform/lang-api/src/com/intellij/codeInspection/InspectionEP.java +++ b/platform/lang-api/src/com/intellij/codeInspection/InspectionEP.java @@ -23,6 +23,7 @@ import com.intellij.lang.LanguageExtensionPoint; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.util.ArrayUtil; import com.intellij.util.xmlb.annotations.Attribute; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; @@ -71,6 +72,20 @@ public class InspectionEP extends LanguageExtensionPoint { @Attribute("groupName") public String groupDisplayName; + /** Comma-delimited list of parent groups (excluding groupName)*/ + @Attribute("groupPath") + public String groupPath; + + public String[] getGroupPath() { + String name = getGroupDisplayName(); + if (groupPath == null) { + return new String[]{name.isEmpty() ? InspectionProfileEntry.GENERAL_GROUP_NAME : name}; + } + else { + return ArrayUtil.append(groupPath.split(","), name); + } + } + @Attribute("enabledByDefault") public boolean enabledByDefault = false; @@ -88,7 +103,7 @@ public class InspectionEP extends LanguageExtensionPoint { } return displayLevel; } - + private String getLocalizedString(String bundleName, String key, String displayName) { if (displayName != null) return displayName; final String baseName = bundleName != null ? bundleName : bundle == null ? ((IdeaPluginDescriptor)myPluginDescriptor).getResourceBundleBaseName() : bundle; @@ -109,5 +124,4 @@ public class InspectionEP extends LanguageExtensionPoint { throw new RuntimeException(e); } } - } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java index 2a9609e47a9a..b34552f74f3f 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolWrapper.java @@ -101,7 +101,7 @@ public abstract class InspectionToolWrapper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/java-i18n/src/META-INF/plugin.xml b/plugins/java-i18n/src/META-INF/plugin.xml index 398fb92da335..7de18ae89b61 100644 --- a/plugins/java-i18n/src/META-INF/plugin.xml +++ b/plugins/java-i18n/src/META-INF/plugin.xml @@ -29,7 +29,7 @@