use of com.intellij.codeInspection.LocalQuickFixOnPsiElement in project intellij-community by JetBrains.
the class HtmlUnknownTagInspection method createChangeTemplateDataFix.
@Nullable
@Override
protected LocalQuickFix createChangeTemplateDataFix(PsiFile file) {
if (file != TemplateLanguageUtil.getTemplateFile(file))
return null;
FileViewProvider vp = file.getViewProvider();
if (vp instanceof ConfigurableTemplateLanguageFileViewProvider) {
final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider) vp;
final String text = LangBundle.message("quickfix.change.template.data.language.text", viewProvider.getTemplateDataLanguage().getDisplayName());
return new LocalQuickFixOnPsiElement(file) {
@NotNull
@Override
public String getText() {
return text;
}
@Override
public void invoke(@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {
ChangeTemplateDataLanguageAction.editSettings(project, file.getVirtualFile());
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return "Change template data language";
}
};
}
return null;
}
Aggregations