void (@NotNull DataContext dataContext) { TemplateGroup group = myConfigurable.getSingleContextGroup(); assert group != null; String buffer = CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor); assert buffer != null; try { LiveTemplateContextService ltContextService = LiveTemplateContextService.getInstance(); for (Element templateElement : JDOMUtil.load("<root>" + buffer + "</root>").getChildren(TemplateSettings.TEMPLATE)) { TemplateImpl template = TemplateSettings.readTemplateFromElement(group.getName(), templateElement, getClass().getClassLoader(), ltContextService); while (group.containsTemplate(template.getKey(), template.getId())) { template.setKey(template.getKey() + "1"); if (template.getId() != null) { template.setId(template.getId() + "1"); } } myConfigurable.addTemplate(template); } } catch (Exception ignore) { } }