void (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { XmlTag tag = ((XmlTag)startElement); XmlTag title = tag.createChildTag(myName, tag.getNamespace(), "", false); XmlTag createdTag = tag.addSubTag(title, false); //Fix all such problems in file (project) if (editor == null) return; editor.getCaretModel().moveToOffset(createdTag.getTextOffset() + title.getTextLength() / 2); }