@Override
    public <T extends PsiElement> T show(@NotNull String errorTitle, @Nullable String selectedTemplateName,
                                         @NotNull final FileCreator<T> creator) {
      final Ref<SmartPsiElementPointer<T>> created = Ref.create(null);
      myDialog.getKindCombo().setSelectedName(selectedTemplateName);
      myDialog.myCreator = new ElementCreator(myProject, errorTitle) {

        @Override
        protected PsiElement @NotNull [] create(@NotNull String newName) {
          T element = creator.createFile(myDialog.getEnteredName(), myDialog.getKindCombo().getSelectedName());
          if (element != null) {
            created.set(SmartPointerManager.getInstance(myProject).createSmartPsiElementPointer(element));
            return new PsiElement[]{element};
          }
          return PsiElement.EMPTY_ARRAY;
        }

        @Override
        public boolean startInWriteAction() {
          return creator.startInWriteAction();
        }

        @Override
        protected @NotNull String getActionName(@NotNull String newName) {
          return creator.getActionName(newName, myDialog.getKindCombo().getSelectedName());
        }
      };

      myDialog.show();
      if (myDialog.getExitCode() == OK_EXIT_CODE) {
        SmartPsiElementPointer<T> pointer = created.get();
        return pointer == null ? null : pointer.getElement();
      }
      return null;
    }
@Override
    public <T extends PsiElement> T show(@NotNull String errorTitle, @Nullable String selectedTemplateName,
                                         @NotNull final FileCreator<T> creator)