public void internalJdkUpdate(@NotNull final Sdk sdk) { GosuSdkAdditionalData data = (GosuSdkAdditionalData) sdk.getSdkAdditionalData(); if (data == null) return; final Sdk javaSdk = data.getJavaSdk(); if (_jdksModel.getIndexOf(javaSdk) == -1) { _jdksModel.addElement(javaSdk); } else { _jdksModel.setSelectedItem(javaSdk); } }
public void updateJdks(Sdk sdk, String previousName) { final Sdk[] sdks = _sdkModel.getSdks(); for (Sdk currentSdk : sdks) { if (currentSdk.getSdkType().equals(GosuSdkType.getInstance())) { final GosuSdkAdditionalData data = (GosuSdkAdditionalData) currentSdk.getSdkAdditionalData(); final Sdk internalJava = data != null ? data.getJavaSdk() : null; if (internalJava != null && Comparing.equal(internalJava.getName(), previousName)) { data.setJavaSdk(sdk); } } } updateJdks(); }
public void init(@NotNull Sdk jdk, @Nullable Sdk androidSdk) { updateJdks(); // if (androidSdk != null) { // for (int i = 0; i < myJdksModel.getSize(); i++) { // if (Comparing.strEqual(((Sdk) myJdksModel.getElementAt(i)).getName(), jdk.getName())) // { // myInternalJdkComboBox.setSelectedIndex(i); // break; // } // } // } String strSdkLocation = androidSdk != null ? androidSdk.getHomePath() : null; this._sdk = jdk; _editCurrentJdk.setText(jdk.getName() + " (" + jdk.getHomePath() + ")"); SdkAdditionalData sdkAdditionalData = androidSdk == null ? null : androidSdk.getSdkAdditionalData(); if (sdkAdditionalData instanceof GosuSdkAdditionalData) { GosuSdkAdditionalData gosuSdkData = (GosuSdkAdditionalData) sdkAdditionalData; GosuVersion version = gosuSdkData.getGosuVersion(); _fieldGosuVersion.setText(version != null ? version.toString() : ""); } // updateBuildTargets(androidSdkObject); // if (buildTarget != null) { // for (int i = 0; i < myBuildTargetsModel.getSize(); i++) { // IGosuTarget target = (IGosuTarget) myBuildTargetsModel.getElementAt(i); // if (buildTarget.hashString().equals(target.hashString())) { // myBuildTargetComboBox.setSelectedIndex(i); // break; // } // } // } }