@Override
  protected void doInvoke(final @NotNull PsiFile file, final int offset, final @NotNull String uri, final Editor editor) throws IncorrectOperationException {
    final MapExternalResourceDialog dialog = new MapExternalResourceDialog(uri, file.getProject(), file, null);
    if (dialog.showAndGet()) {
      ApplicationManager.getApplication().runWriteAction(() -> {
        String location = dialog.getResourceLocation();
        ExternalResourceManager.getInstance().addResource(dialog.getUri(), location);
      });
    }
  }
@Override
  protected void doInvoke(final @NotNull PsiFile file, final int offset, final @NotNull String uri, final Editor editor)