AnAction (final Project project, final Consumer<? super BaseInjection> consumer, final AbstractLanguageInjectionSupport support) { final String supportTitle = StringUtil.capitalize(support.getId()); Icon icon = FileTypeManager.getInstance().getFileTypeByExtension(support.getId()).getIcon(); AnAction action = DumbAwareAction.create(e -> { BaseInjection injection = new BaseInjection(support.getId()); injection.setDisplayName(IntelliLangBundle.message("new.language.name.injection", supportTitle)); final BaseInjection newInjection = showDefaultInjectionUI(project, injection); if (newInjection != null) { consumer.consume(injection); } }); action.getTemplatePresentation().setText(IntelliLangBundle.message("action.text.generic.0", supportTitle)); action.getTemplatePresentation().setIcon(icon); return action; }