BaseInjection (final Project project, final BaseInjection xmlInjection) { final AbstractInjectionPanel panel; String helpId; if (xmlInjection instanceof XmlTagInjection) { panel = new XmlTagPanel((XmlTagInjection)xmlInjection, project); helpId = "reference.settings.injection.language.injection.settings.xml.tag"; } else if (xmlInjection instanceof XmlAttributeInjection) { panel = new XmlAttributePanel((XmlAttributeInjection)xmlInjection, project); helpId = "reference.settings.injection.language.injection.settings.xml.attribute"; } else { throw new AssertionError(); } panel.reset(); return showEditInjectionDialog(project, panel, null, helpId) ? xmlInjection.copy() : null; }