diff --git a/java/java-impl/src/META-INF/JavaPlugin.xml b/java/java-impl/src/META-INF/JavaPlugin.xml index 368d284093b4..bed2b27542d1 100644 --- a/java/java-impl/src/META-INF/JavaPlugin.xml +++ b/java/java-impl/src/META-INF/JavaPlugin.xml @@ -528,6 +528,7 @@ serviceImplementation="com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl" overrides="true"/> + diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JdkUpdaterConfigurable.kt b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JdkUpdaterConfigurable.kt new file mode 100644 index 000000000000..fb3bb5bf9c02 --- /dev/null +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JdkUpdaterConfigurable.kt @@ -0,0 +1,22 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.openapi.projectRoots.impl + +import com.intellij.java.JavaBundle +import com.intellij.openapi.updateSettings.impl.UpdateSettingsUIProvider +import com.intellij.openapi.util.registry.Registry +import com.intellij.ui.dsl.builder.BottomGap +import com.intellij.ui.dsl.builder.Panel +import com.intellij.ui.dsl.builder.bindSelected + +class JdkUpdaterConfigurable: UpdateSettingsUIProvider { + + override fun init(panel: Panel) { + panel.apply { + row { + checkBox(JavaBundle.message("checkbox.check.for.jdk.updates")) + .bindSelected({ Registry.`is`("jdk.updater") }, { Registry.get("jdk.updater").setValue(it) }) + } + .bottomGap(BottomGap.MEDIUM) + } + } +} \ No newline at end of file diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 73dcef917eb9..81f095039ec5 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -1932,4 +1932,5 @@ intention.name.delete.method=Delete method ''{0}()'' intention.name.delete.method.title=Delete Method ''{0}()'' intention.name.delete.method.with.callees=... along with other private methods used only there intention.name.delete.method.only=... and nothing else -intention.family.name.delete.private.method=Delete private method \ No newline at end of file +intention.family.name.delete.private.method=Delete private method +checkbox.check.for.jdk.updates=Check for JDK updates \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.kt index abdec8ec88c0..54ff237c80c0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.kt +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.kt @@ -136,6 +136,10 @@ class UpdateSettingsConfigurable @JvmOverloads constructor (private val checkNow var wasEnabled = settings.isCheckNeeded || settings.isPluginsCheckNeeded + UpdateSettingsUIProvider.EP_NAME.forEachExtensionSafe { + it.init(this) + } + onApply { val isEnabled = settings.isCheckNeeded || settings.isPluginsCheckNeeded if (isEnabled != wasEnabled) { diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsUIProvider.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsUIProvider.kt new file mode 100644 index 000000000000..8341fd976824 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsUIProvider.kt @@ -0,0 +1,18 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.openapi.updateSettings.impl + +import com.intellij.openapi.extensions.ExtensionPointName +import com.intellij.ui.dsl.builder.Panel +import org.jetbrains.annotations.ApiStatus + +/** + * This EP makes it possible for plugins to add any UI to Settings | Appearance & Behavior | System Settings | Updates. + */ +interface UpdateSettingsUIProvider { + companion object { + @ApiStatus.Internal + val EP_NAME = ExtensionPointName("com.intellij.updateSettingsUIProvider") + } + + fun init(panel: Panel) +} \ No newline at end of file diff --git a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml index bea10756bd32..e1d092747e44 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml @@ -395,6 +395,7 @@ +