Show dialog if more than one module should be configured or user should choose path to library
This commit is contained in:
@@ -67,14 +67,19 @@ public class KotlinJavaModuleConfigurator extends KotlinWithLibraryConfigurator
|
||||
|
||||
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||
|
||||
CreateJavaLibraryDialogWithModules dialog =
|
||||
new CreateJavaLibraryDialogWithModules(project, nonConfiguredModules, defaultPath, showPathPanelForJava);
|
||||
dialog.show();
|
||||
|
||||
if (!dialog.isOK()) return;
|
||||
|
||||
for (Module module : dialog.getModulesToConfigure()) {
|
||||
configureModuleWithLibrary(module, defaultPath, dialog.getCopyIntoPath());
|
||||
if (nonConfiguredModules.size() > 1 || showPathPanelForJava) {
|
||||
CreateJavaLibraryDialogWithModules dialog =
|
||||
new CreateJavaLibraryDialogWithModules(project, nonConfiguredModules, defaultPath, showPathPanelForJava);
|
||||
dialog.show();
|
||||
if (!dialog.isOK()) return;
|
||||
for (Module module : dialog.getModulesToConfigure()) {
|
||||
configureModuleWithLibrary(module, defaultPath, dialog.getCopyIntoPath());
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (Module module : nonConfiguredModules) {
|
||||
configureModuleWithLibrary(module, defaultPath, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,18 +92,24 @@ public class KotlinJsModuleConfigurator extends KotlinWithLibraryConfigurator {
|
||||
|
||||
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||
|
||||
CreateJavaScriptLibraryDialogWithModules dialog =
|
||||
new CreateJavaScriptLibraryDialogWithModules(project, nonConfiguredModules,
|
||||
defaultPathToJar, defaultPathToJsFile,
|
||||
showPathToJarPanel, showPathToJsFilePanel);
|
||||
dialog.show();
|
||||
|
||||
if (!dialog.isOK()) return;
|
||||
|
||||
for (Module module : dialog.getModulesToConfigure()) {
|
||||
configureModuleWithLibrary(module, defaultPathToJar, dialog.getCopyLibraryIntoPath());
|
||||
if (nonConfiguredModules.size() > 1 || showPathToJarPanel || showPathToJsFilePanel) {
|
||||
CreateJavaScriptLibraryDialogWithModules dialog =
|
||||
new CreateJavaScriptLibraryDialogWithModules(project, nonConfiguredModules,
|
||||
defaultPathToJar, defaultPathToJsFile,
|
||||
showPathToJarPanel, showPathToJsFilePanel);
|
||||
dialog.show();
|
||||
if (!dialog.isOK()) return;
|
||||
for (Module module : dialog.getModulesToConfigure()) {
|
||||
configureModuleWithLibrary(module, defaultPathToJar, dialog.getCopyLibraryIntoPath());
|
||||
}
|
||||
configureModuleWithJsFile(defaultPathToJsFile, dialog.getCopyJsIntoPath());
|
||||
}
|
||||
else {
|
||||
for (Module module : nonConfiguredModules) {
|
||||
configureModuleWithLibrary(module, defaultPathToJar, null);
|
||||
}
|
||||
configureModuleWithJsFile(defaultPathToJsFile, null);
|
||||
}
|
||||
configureModuleWithJsFile(defaultPathToJsFile, dialog.getCopyJsIntoPath());
|
||||
}
|
||||
|
||||
public static boolean isJsFilePresent(@NotNull String dir) {
|
||||
|
||||
Reference in New Issue
Block a user