mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
243 feature/29/hightlight axiom jdk simple
This commit is contained in:
@@ -120,7 +120,11 @@ private class JdkVersionVendorCombobox: ComboBox<JdkVersionVendorItem>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun customize(item: SimpleColoredComponent, value: JdkVersionVendorItem, index: Int, isSelected: Boolean, hasFocus: Boolean) {
|
override fun customize(item: SimpleColoredComponent, value: JdkVersionVendorItem, index: Int, isSelected: Boolean, hasFocus: Boolean) {
|
||||||
item.append(value.item.product.packagePresentationText, SimpleTextAttributes.REGULAR_ATTRIBUTES)
|
val title = value.item.product.packagePresentationText.replace("Axiom JSC", "").trim()
|
||||||
|
if (isLicenseAcceptedJDK(value))
|
||||||
|
item.append(title, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES)
|
||||||
|
else
|
||||||
|
item.append(title, SimpleTextAttributes.REGULAR_ATTRIBUTES)
|
||||||
|
|
||||||
val additionalInfo = mutableListOf<String>()
|
val additionalInfo = mutableListOf<String>()
|
||||||
val jdkVersion = value.item.jdkVersion
|
val jdkVersion = value.item.jdkVersion
|
||||||
@@ -133,7 +137,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
|
@VisibleForTesting
|
||||||
@Internal
|
@Internal
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ data class JdkItem(
|
|||||||
val jdkVendorVersion: String?,
|
val jdkVendorVersion: String?,
|
||||||
val suggestedSdkName: String,
|
val suggestedSdkName: String,
|
||||||
|
|
||||||
|
val isLicenseAccepted: Boolean,
|
||||||
|
|
||||||
val os: String,
|
val os: String,
|
||||||
/**
|
/**
|
||||||
* @see presentableArchIfNeeded
|
* @see presentableArchIfNeeded
|
||||||
@@ -434,6 +436,8 @@ object JdkListParser {
|
|||||||
jdkVendorVersion = (item["jdk_vendor_version"] as? JsonPrimitive)?.contentOrNull,
|
jdkVendorVersion = (item["jdk_vendor_version"] as? JsonPrimitive)?.contentOrNull,
|
||||||
suggestedSdkName = (item["suggested_sdk_name"] as? JsonPrimitive)?.contentOrNull ?: return emptyList(),
|
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(),
|
os = (pkg["os"] as? JsonPrimitive)?.contentOrNull ?: return emptyList(),
|
||||||
arch = (pkg["arch"] 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(),
|
packageType = (pkg["package_type"] as? JsonPrimitive)?.contentOrNull?.let(JdkPackageType.Companion::findType) ?: return emptyList(),
|
||||||
|
|||||||
Reference in New Issue
Block a user