@Override
    public NewArtifactConfiguration createArtifact() {
      final Module module;
      if (myModules.size() == 1) {
        module = myModules.get(0);
      } else {
        final ChooseModulesDialog dialog = new ChooseModulesDialog(myModules.get(0).getProject(), myModules,
                                                                   JavaFXBundle.message("dialog.title.select.module.for.artifact"),
                                                                   JavaFXBundle.message(
                                                                     "label.selected.module.output.would.to.be.included.in.artifact"));
        dialog.setSingleSelectionMode();
        if (dialog.showAndGet()) {
          final List<Module> elements = dialog.getChosenElements();
          if (elements.isEmpty()) {
            return null;
          }
          module = elements.get(0);
        }
        else {
          module = null;
        }
      }
      if (module == null) return null;
      final CompositePackagingElement<?> rootElement = JPackageArtifactType.this.createRootElement(module.getName());
      final CompositePackagingElement<?>
        subElement = PackagingElementFactory.getInstance().createArchive(FileUtil.sanitizeFileName(module.getName()) + ".jar");
      final PackagingElement<?> moduleOutputElement = PackagingElementFactory.getInstance().createModuleOutput(module);
      subElement.addFirstChild(moduleOutputElement);
      rootElement.addFirstChild(subElement);
      return new NewArtifactConfiguration(rootElement, module.getName(), JPackageArtifactType.this);
    }
@Override
    public NewArtifactConfiguration createArtifact()