NewArtifactConfiguration () { Module module = null; 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); } } if (module == null) return null; final CompositePackagingElement<?> rootElement = JavaFxApplicationArtifactType.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(), JavaFxApplicationArtifactType.this); }