From c24a004ee56e443c5575be3452a953beda257210 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Thu, 19 Apr 2012 12:35:45 +0400 Subject: [PATCH] Help IDs for Groovy, PHP, JS injection support settings (IDEA-84831, WI-7913) --- .../inject/java/JavaLanguageInjectionSupport.java | 5 +++++ .../inject/AbstractLanguageInjectionSupport.java | 10 +++++++++- .../inject/groovy/GroovyLanguageInjectionSupport.java | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java index 27ed1945bbd5..22a84364d416 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java @@ -489,4 +489,9 @@ public class JavaLanguageInjectionSupport extends AbstractLanguageInjectionSuppo super.setupPresentation(injection, presentation, isSelected); } } + + @Override + public String getHelpId() { + return "reference.settings.injection.language.injection.settings.java.parameter"; + } } diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/AbstractLanguageInjectionSupport.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/AbstractLanguageInjectionSupport.java index 584cb1ecc36b..6ba500af8a10 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/AbstractLanguageInjectionSupport.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/AbstractLanguageInjectionSupport.java @@ -116,7 +116,10 @@ public abstract class AbstractLanguageInjectionSupport extends LanguageInjection final BaseInjectionPanel panel = new BaseInjectionPanel(injection, project); panel.reset(); final DialogBuilder builder = new DialogBuilder(project); - builder.setHelpId("reference.settings.injection.language.injection.settings.java.parameter"); + LanguageInjectionSupport support = InjectorUtils.findInjectionSupport(injection.getSupportId()); + if (support != null && support instanceof AbstractLanguageInjectionSupport) { + builder.setHelpId(((AbstractLanguageInjectionSupport)support).getHelpId()); + } builder.addOkAction(); builder.addCancelAction(); builder.setDimensionServiceKey("#org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionDialog"); @@ -150,4 +153,9 @@ public abstract class AbstractLanguageInjectionSupport extends LanguageInjection public boolean equals(Object obj) { return obj instanceof LanguageInjectionSupport && getId().equals(((LanguageInjectionSupport)obj).getId()); } + + @Nullable + public String getHelpId() { + return null; + } } diff --git a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GroovyLanguageInjectionSupport.java b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GroovyLanguageInjectionSupport.java index 2da7f3819ddc..f19c1bf888f7 100644 --- a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GroovyLanguageInjectionSupport.java +++ b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GroovyLanguageInjectionSupport.java @@ -42,4 +42,9 @@ public class GroovyLanguageInjectionSupport extends AbstractLanguageInjectionSup public boolean useDefaultInjector(final PsiElement host) { return host instanceof GroovyPsiElement; } + + @Override + public String getHelpId() { + return "reference.settings.language.injection.groovy"; + } }