AnAction[] (final Project project, final Consumer<? super BaseInjection> consumer) { return new AnAction[] { new AnAction(IntelliLangBundle.messagePointer("action.XmlLanguageInjectionSupport.Anonymous.xml.tag.injection"), Presentation.NULL_STRING, PlatformIcons.XML_TAG_ICON) { @Override public void actionPerformed(@NotNull final AnActionEvent e) { final BaseInjection newInjection = showInjectionUI(project, new XmlTagInjection()); if (newInjection != null) consumer.consume(newInjection); } }, new AnAction(IntelliLangBundle.messagePointer("action.XmlLanguageInjectionSupport.Anonymous.xml.attribute.injection"), Presentation.NULL_STRING, PlatformIcons.ANNOTATION_TYPE_ICON) { @Override public void actionPerformed(@NotNull final AnActionEvent e) { final BaseInjection injection = showInjectionUI(project, new XmlAttributeInjection()); if (injection != null) consumer.consume(injection); } } }; }