From 9c60f9d3f8344f37db21f65abdc2a3e01e56ead8 Mon Sep 17 00:00:00 2001 From: Louis Vignier Date: Wed, 21 Jan 2026 13:59:48 +0100 Subject: [PATCH] IDEA-384932 jdk: remove the JDK configured notification #IDEA-384932 Fixed Space-RevId: 2ec356eb8266245533f847b177976c5ea1464dff GitOrigin-RevId: 18dd09053b2d1b6cff418c58cfe8a976af89037e --- .../com/intellij/ide/actions/AddJdkAction.kt | 4 +- .../intellij/ide/actions/DownloadJdkAction.kt | 4 +- .../resources/META-INF/JavaPlugin.xml | 1 - .../impl/ExternalJavaConfigurationService.kt | 11 +-- .../openapi/projectRoots/impl/jdkService.kt | 18 +---- .../resources/messages/JavaBundle.properties | 3 - .../messages/ProjectBundle.properties | 10 --- .../impl/UnknownMissingSdkFixLocal.java | 6 +- .../impl/UnknownSdkBalloonNotification.java | 77 ------------------- .../projectRoots/impl/UnknownSdkTracker.java | 4 +- 10 files changed, 9 insertions(+), 129 deletions(-) delete mode 100644 platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkBalloonNotification.java diff --git a/java/idea-ui/src/com/intellij/ide/actions/AddJdkAction.kt b/java/idea-ui/src/com/intellij/ide/actions/AddJdkAction.kt index 3040ffa265ae..72649b835ac4 100644 --- a/java/idea-ui/src/com/intellij/ide/actions/AddJdkAction.kt +++ b/java/idea-ui/src/com/intellij/ide/actions/AddJdkAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.actions import com.intellij.openapi.actionSystem.ActionUpdateThread @@ -18,7 +18,7 @@ class AddJdkAction : AnAction() { SdkConfigurationUtil.selectSdkHome(sdk) { path -> service().createJdkFromPath(path) { - e.project?.service()?.setProjectJdkIfNull(it, true) + e.project?.service()?.setProjectJdkIfNull(it) } } } diff --git a/java/idea-ui/src/com/intellij/ide/actions/DownloadJdkAction.kt b/java/idea-ui/src/com/intellij/ide/actions/DownloadJdkAction.kt index c19a7c4c3f8a..c7b0fb0a9b54 100644 --- a/java/idea-ui/src/com/intellij/ide/actions/DownloadJdkAction.kt +++ b/java/idea-ui/src/com/intellij/ide/actions/DownloadJdkAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.actions import com.intellij.ide.projectWizard.generators.JdkDownloadService @@ -28,7 +28,7 @@ class DownloadJdkAction: AnAction() { downloadExtension.showDownloadUI(sdkType, ProjectSdksModel(), null, project, null, { true }) { task: SdkDownloadTask -> val sdk = JdkDownloadService.setupInstallableSdk(task) project.service().scheduleDownloadSdk(sdk) - project.service().setProjectJdkIfNull(sdk, true) + project.service().setProjectJdkIfNull(sdk) } } else { log.warn("No download extension found to download a JDK") diff --git a/java/java-backend/resources/META-INF/JavaPlugin.xml b/java/java-backend/resources/META-INF/JavaPlugin.xml index 44c329082d54..20412bc94572 100644 --- a/java/java-backend/resources/META-INF/JavaPlugin.xml +++ b/java/java-backend/resources/META-INF/JavaPlugin.xml @@ -1344,7 +1344,6 @@ key="notification.group.preview.features"/> - diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/ExternalJavaConfigurationService.kt b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/ExternalJavaConfigurationService.kt index 3eb08f79dfc7..110fd49779af 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/ExternalJavaConfigurationService.kt +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/ExternalJavaConfigurationService.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 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.codeInsight.codeVision.CodeVisionHost @@ -152,15 +152,6 @@ public class ExternalJavaConfigurationService(public val project: Project, priva // Update status and refresh inlays after configuration setStatus(filePath, JavaConfigurationStatus.AlreadyConfigured) - - NotificationGroupManager.getInstance() - .getNotificationGroup("Setup JDK") - .createNotification( - JavaBundle.message("sdk.configured.external.config.title", fileName), - JavaBundle.message("sdk.configured", jdk.versionString), - NotificationType.INFORMATION - ) - .notify(project) } } diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/jdkService.kt b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/jdkService.kt index e1ea218a9bc7..a9dac3eab3fc 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/jdkService.kt +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/jdkService.kt @@ -1,9 +1,6 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 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.notification.NotificationGroupManager -import com.intellij.notification.NotificationType import com.intellij.openapi.application.edtWriteAction import com.intellij.openapi.application.invokeAndWaitIfNeeded import com.intellij.openapi.components.Service @@ -50,7 +47,7 @@ public class AddJdkService(private val coroutineScope: CoroutineScope) { @Service(Service.Level.PROJECT) @ApiStatus.Internal public class ConfigureJdkService(public val project: Project, private val coroutineScope: CoroutineScope) { - public fun setProjectJdkIfNull(sdk: Sdk, notify: Boolean = false) { + public fun setProjectJdkIfNull(sdk: Sdk) { if (project.isDisposed) return val rootsManager = ProjectRootManager.getInstance(project) if (rootsManager.projectSdk == null) { @@ -58,17 +55,6 @@ public class ConfigureJdkService(public val project: Project, private val corout edtWriteAction { rootsManager.projectSdk = sdk } - - if (notify) { - NotificationGroupManager.getInstance() - .getNotificationGroup("Setup JDK") - .createNotification( - JavaBundle.message("sdk.configured.notification.title"), - JavaBundle.message("sdk.configured", sdk.name), - NotificationType.INFORMATION - ) - .notify(project) - } } } } diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 7ec47a2a44e7..82a25f05d619 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -1213,9 +1213,6 @@ scheduled.thread.pool.executor.with.zero.core.threads.description='ScheduledThre scope.hierarchy=Hierarchy of {0} sdk.cannot.create=Cannot Create SDK sdk.java.no.classes=Cannot find JDK classes in ''{0}'' -sdk.configured.external.config.title=JDK is configured ({0}) -sdk.configured.notification.title=JDK configured -sdk.configured=''{0}'' is set as project JDK. section.title.inspection.suspicious.names.ignore.methods=Ignore methods: set.language.level=Set language level set.language.level.to.0=Set language level to {0} diff --git a/platform/ide-core/resources/messages/ProjectBundle.properties b/platform/ide-core/resources/messages/ProjectBundle.properties index 3458033cc838..bf0325b8a0e7 100644 --- a/platform/ide-core/resources/messages/ProjectBundle.properties +++ b/platform/ide-core/resources/messages/ProjectBundle.properties @@ -33,7 +33,6 @@ sdk.configure.download.action=Download {0}\u2026 sdk.configure.download.actionTitle=Download {0}\u2026 sdk.configure.downloading=Downloading {0}\u2026 sdk.configure.type.home.path={0} home path: -sdk.configure.checking.home.path.validity=Checking home path validity sdk.configure.home.invalid.error=The selected directory is not a valid home for {0} sdk.configure.home.file.invalid.error=The selected file is not a valid home for {0} sdk.configure.home.title=Select Home Directory for {0} @@ -233,11 +232,6 @@ dialog.title.new.project=New Project label.new.project=New project item.text.empty.project=Empty Project progress.title.downloading.sdk=Configuring SDK -notification.title.sdks.configured=SDKs are configured -notification.link.change.sdks=Change SDKs\u2026 -notification.link.change.sdk=Change {0}\u2026 -notification.title.sdk.configured={0} is configured -notification.text.sdk.usage.is.set.to="{0}" is set to {1} progress.title.downloading.jdk.list=Downloading JDK List progress.text.downloading.jdk.list=Downloading JDK list\u2026 progress.text.resolving.hint.path=Resolving hint path: {0}\u2026 @@ -266,10 +260,6 @@ dialog.message.error.target.path.exists.file=Target path is an existing file dialog.message.error.target.path.exists.nonEmpty.dir=Target path is an existing non-empty directory progress.text.installing.jdk.1=Installing {0}\u2026 advanced.setting.sdk.configuration=SDK configuration -advanced.setting.sdk.configuration.install.request=On SDK install request -advanced.setting.sdk.configuration.install.request.accept=Always download -advanced.setting.sdk.configuration.install.request.deny=Always deny -advanced.setting.sdk.configuration.install.request.ask=Always ask dialog.sdk.download.title=Download SDK? dialog.sdk.download.message.with.reason={0}\n\n{1} dialog.sdk.download.message={0} wants to download {1}. diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownMissingSdkFixLocal.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownMissingSdkFixLocal.java index 08fadd8931f8..ea939505fe7f 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownMissingSdkFixLocal.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownMissingSdkFixLocal.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 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.openapi.application.ApplicationManager; @@ -62,10 +62,6 @@ final class UnknownMissingSdkFixLocal extends UnknownSdkFixActionLocalBase imple return ProjectBundle.message("config.unknown.sdk.local", sdkTypeName, myFix.getPresentableVersionString()); } - public @NotNull @Nls String getActionAppliedMessage() { - return ProjectBundle.message("notification.text.sdk.usage.is.set.to", getSdkNameForUi(), myFix.getVersionString()); - } - @Override public @NotNull @Nls String getActionDetailedText() { String sdkTypeName = mySdk.getSdkType().getPresentableName(); diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkBalloonNotification.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkBalloonNotification.java deleted file mode 100644 index 178823736f84..000000000000 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkBalloonNotification.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2000-2022 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.notification.NotificationGroupManager; -import com.intellij.notification.NotificationType; -import com.intellij.openapi.components.Service; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectBundle; -import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; -import com.intellij.openapi.roots.ui.configuration.SdkListPresenter; -import com.intellij.openapi.roots.ui.configuration.UnknownSdk; -import com.intellij.openapi.roots.ui.configuration.UnknownSdkLocalSdkFix; -import com.intellij.openapi.util.text.HtmlBuilder; -import com.intellij.openapi.util.text.HtmlChunk; -import com.intellij.openapi.util.text.StringUtil; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nls; -import org.jetbrains.annotations.NotNull; - -import java.util.List; -import java.util.Set; -import java.util.TreeSet; - -import static com.intellij.notification.NotificationAction.createSimple; - -@ApiStatus.Internal -@Service(Service.Level.PROJECT) -public final class UnknownSdkBalloonNotification { - public static @NotNull UnknownSdkBalloonNotification getInstance(@NotNull Project project) { - return project.getService(UnknownSdkBalloonNotification.class); - } - - private final Project myProject; - - public UnknownSdkBalloonNotification(@NotNull Project project) { - myProject = project; - } - - public void notifyFixedSdks(@NotNull List localFixes) { - if (localFixes.isEmpty()) return; - - Set<@Nls String> usages = new TreeSet<>(); - for (var entry : localFixes) { - UnknownSdkLocalSdkFix fix = entry.getLocalSdkFix(); - String usageText = ProjectBundle.message("notification.text.sdk.usage.is.set.to", entry.getSdkNameForUi(), fix.getVersionString()); - usages.add(new HtmlBuilder() - .append(usageText) - .append(HtmlChunk.br()) - .append(SdkListPresenter.presentDetectedSdkPath(fix.getExistingSdkHome())) - .toString()); - } - - @Nls String message = StringUtil.join(usages, "

"); - String title, change; - if (localFixes.size() == 1) { - var entry = localFixes.iterator().next(); - UnknownSdk info = entry.getUnknownSdk(); - String sdkTypeName = info.getSdkType().getPresentableName(); - title = ProjectBundle.message("notification.title.sdk.configured", sdkTypeName); - change = ProjectBundle.message("notification.link.change.sdk", sdkTypeName); - } - else { - title = ProjectBundle.message("notification.title.sdks.configured"); - change = ProjectBundle.message("notification.link.change.sdks"); - } - - if (message.isBlank()) return; - - NotificationGroupManager.getInstance().getNotificationGroup("Missing SDKs") - .createNotification(title, message, NotificationType.INFORMATION) - .setImportant(true) - .addAction(createSimple( - change, - () -> ProjectSettingsService.getInstance(myProject).openProjectSettings())) - .notify(myProject); - } -} diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkTracker.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkTracker.java index 4b2faef2859a..d97c88e6f59e 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkTracker.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/UnknownSdkTracker.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 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.openapi.components.Service; @@ -287,7 +287,6 @@ public final class UnknownSdkTracker { } } - UnknownSdkBalloonNotification.getInstance(myProject).notifyFixedSdks(localFixes); indicator.popState(); } return otherFixes; @@ -309,7 +308,6 @@ public final class UnknownSdkTracker { } finally { indicator.popState(); - UnknownSdkBalloonNotification.getInstance(myProject).notifyFixedSdks(List.of((UnknownMissingSdkFixLocal)fix)); } }