@Override
  public boolean execute() {
    final int offset = myElement.getTextOffset();
    final RangeMarker marker = myEditor.getDocument().createRangeMarker(offset, offset);
    Consumer<String> consumer = (namespace) -> {
      if (namespace != null) {
          final Project project = myFile.getProject();
           WriteCommandAction.writeCommandAction(project, myFile) . run(() -> {
              final XmlNamespaceHelper extension = XmlNamespaceHelper.getHelper(myFile);
              final String prefix = extension.getNamespacePrefix(myElement);
              extension.insertNamespaceDeclaration(myFile,
                                                   myEditor,
                                                   Collections.singleton(namespace),
                                                   prefix,
                                                   new XmlNamespaceHelper.Runner<>() {
                                                     @Override
                                                     public void run(final String s) throws IncorrectOperationException {
                                                       PsiDocumentManager.getInstance(myFile.getProject())
                                                         .doPostponedOperationsAndUnblockDocument(myEditor.getDocument());
                                                       PsiElement element = myFile.findElementAt(marker.getStartOffset());
                                                       if (element != null) {
                                                         extension.qualifyWithPrefix(s, element, myEditor.getDocument());
                                                       }
                                                     }
                                                   }
              );
            }
          );
      }
    };
    if (myNamespaces.size() == 1) {
      consumer.consume(myNamespaces.get(0));
    } else {
      JBPopupFactory.getInstance()
        .createPopupChooserBuilder(myNamespaces)
        .setItemChosenCallback(consumer)
        .setRenderer(XmlNSRenderer.INSTANCE)
        .setTitle(myTitle)
        .createPopup()
        .showInBestPositionFor(myEditor);
    }

    return true;
  }
@Override
  public boolean execute()