243 feature/29/hightlight axiom jdk simple

(cherry picked from commit 163535d225638bd26e63dbd4b14723e9ef3734d4)
(cherry picked from commit e4517868e5)
(cherry picked from commit e27fddc012)
(cherry picked from commit 6ca0ab9d47)
(cherry picked from commit 4036889dfa)
This commit is contained in:
Nikita Iarychenko
2025-02-07 10:29:28 +04:00
parent a11be0c5d7
commit b3980d7f3d
2 changed files with 18 additions and 2 deletions

View File

@@ -117,7 +117,8 @@ private class JdkVersionVendorCombobox: ComboBox<JdkVersionVendorItem>() {
isSwingPopup = false
renderer = listCellRenderer<JdkVersionVendorItem>("") {
text(value.item.product.packagePresentationText)
val title = value.item.product.packagePresentationText.replace("Axiom JSC", "").trim()
text(title)
text(value.item.jdkVersion) {
foreground = greyForeground
@@ -138,7 +139,18 @@ private class JdkVersionVendorCombobox: ComboBox<JdkVersionVendorItem>() {
}
}
private fun List<JdkVersionVendorItem>.sortedForUI() = this.sortedBy { it.item.product.packagePresentationText.lowercase() }
private fun List<JdkVersionVendorItem>.sortedForUI() = this
.sortedWith(
Comparator { i1, i2 ->
val s1: String = i1.item.product.packagePresentationText
val s2: String = i2.item.product.packagePresentationText
if (s1.contains("Axiom", ignoreCase = true)) -1
else s1.compareTo(s2)
}
)
private fun isLicenseAcceptedJDK(vendor: JdkVersionVendorItem): Boolean = vendor.item.isLicenseAccepted
@VisibleForTesting
@Internal

View File

@@ -97,6 +97,8 @@ data class JdkItem(
val jdkVendorVersion: String?,
val suggestedSdkName: String,
val isLicenseAccepted: Boolean,
val os: String,
/**
* @see presentableArchIfNeeded
@@ -484,6 +486,8 @@ object JdkListParser {
jdkVendorVersion = (item["jdk_vendor_version"] as? JsonPrimitive)?.contentOrNull,
suggestedSdkName = (item["suggested_sdk_name"] as? JsonPrimitive)?.contentOrNull ?: return emptyList(),
isLicenseAccepted = item["is_license_accepted"]?.let { filters.testPredicate(it) == true } ?: false,
os = (pkg["os"] as? JsonPrimitive)?.contentOrNull ?: return emptyList(),
arch = (pkg["arch"] as? JsonPrimitive)?.contentOrNull ?: return emptyList(),
packageType = (pkg["package_type"] as? JsonPrimitive)?.contentOrNull?.let(JdkPackageType.Companion::findType) ?: return emptyList(),