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);
|
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||||
|
|
||||||
CreateJavaLibraryDialogWithModules dialog =
|
if (nonConfiguredModules.size() > 1 || showPathPanelForJava) {
|
||||||
new CreateJavaLibraryDialogWithModules(project, nonConfiguredModules, defaultPath, showPathPanelForJava);
|
CreateJavaLibraryDialogWithModules dialog =
|
||||||
dialog.show();
|
new CreateJavaLibraryDialogWithModules(project, nonConfiguredModules, defaultPath, showPathPanelForJava);
|
||||||
|
dialog.show();
|
||||||
if (!dialog.isOK()) return;
|
if (!dialog.isOK()) return;
|
||||||
|
for (Module module : dialog.getModulesToConfigure()) {
|
||||||
for (Module module : dialog.getModulesToConfigure()) {
|
configureModuleWithLibrary(module, defaultPath, dialog.getCopyIntoPath());
|
||||||
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);
|
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||||
|
|
||||||
CreateJavaScriptLibraryDialogWithModules dialog =
|
if (nonConfiguredModules.size() > 1 || showPathToJarPanel || showPathToJsFilePanel) {
|
||||||
new CreateJavaScriptLibraryDialogWithModules(project, nonConfiguredModules,
|
CreateJavaScriptLibraryDialogWithModules dialog =
|
||||||
defaultPathToJar, defaultPathToJsFile,
|
new CreateJavaScriptLibraryDialogWithModules(project, nonConfiguredModules,
|
||||||
showPathToJarPanel, showPathToJsFilePanel);
|
defaultPathToJar, defaultPathToJsFile,
|
||||||
dialog.show();
|
showPathToJarPanel, showPathToJsFilePanel);
|
||||||
|
dialog.show();
|
||||||
if (!dialog.isOK()) return;
|
if (!dialog.isOK()) return;
|
||||||
|
for (Module module : dialog.getModulesToConfigure()) {
|
||||||
for (Module module : dialog.getModulesToConfigure()) {
|
configureModuleWithLibrary(module, defaultPathToJar, dialog.getCopyLibraryIntoPath());
|
||||||
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) {
|
public static boolean isJsFilePresent(@NotNull String dir) {
|
||||||
|
|||||||
Reference in New Issue
Block a user