public static void chooseTypeAndCreate(final ClasspathPanel classpathPanel,
                                         final StructureConfigurableContext context,
                                         final JButton contextButton, @NotNull final LibraryCreatedCallback callback) {
    if (LibraryEditingUtil.hasSuitableTypes(classpathPanel)) {
      final ListPopup popup = JBPopupFactory.getInstance().createListPopup(LibraryEditingUtil.createChooseTypeStep(classpathPanel,
                                                                                                                   libraryType -> doCreateLibrary(classpathPanel, context, callback, contextButton, libraryType)));
      popup.showUnderneathOf(contextButton);
    }
    else {
      doCreateLibrary(classpathPanel, context, callback, contextButton, null);
    }
  }
public static void chooseTypeAndCreate(final ClasspathPanel classpathPanel,
                                         final StructureConfigurableContext context,
                                         final JButton contextButton, @NotNull final LibraryCreatedCallback callback)