void () { final SdkType sdkType = (SdkType)mySdk.getSdkType(); //handle tests behaviour if (SdkConfigurationUtil.selectSdkHomeForTests(sdkType, path -> doSetHomePath(path, sdkType))) { return; } SdkPopupFactory .newBuilder() .withSdkType(sdkType) .withSdkFilter(sdk -> { if (sdk == null) return false; if (sdk.getName().equals(this.myInitialName)) return false; if (sdk.getName().equals(mySdk.getName())) return false; if (FileUtil.pathsEqual(sdk.getHomePath(), mySdk.getHomePath())) return false; return true; }) .onSdkSelected(sdk -> { SdkDownloadTracker tracker = SdkDownloadTracker.getInstance(); if (tracker.isDownloading(sdk)) { //make sure the current SDK is registered as downloading one tracker.registerEditableSdk(sdk, mySdk); //we need to bind with the original Sdk too var originalSdkEntry = ContainerUtil.find(mySdkModel.getProjectSdks().entrySet(), p -> p.getValue().equals(mySdk)); if (originalSdkEntry != null) { tracker.registerEditableSdk(sdk, originalSdkEntry.getKey()); } //reset the view to make it bind to the downloading JDK reset(); } else { doSetHomePath(sdk.getHomePath(), sdkType); } }) .withOwnProjectSdksModel(new ProjectSdksModel() { @Override protected boolean forceAddActionToSelectFromDisk(@NotNull SdkType type) { //make the `Add` action use the original SdkConfigurationUtil.selectSdkHome method return true; } }) .buildPopup() .showUnderneathToTheRightOf(myHomeComponent); }