From 9f05fbbcb359eb607506199a7199fee6b901245a Mon Sep 17 00:00:00 2001 From: Nikita Iarychenko Date: Fri, 28 Nov 2025 11:25:19 +0400 Subject: [PATCH] IDEA-359334 Action Gradle.DownloadSources always visible in all AbstractExternalSystemToolWindowFactory implemetations (cherry picked from commit df6e7055157566c30c6aae9f46e97cde4ec458fc) (cherry picked from commit 1a744d016518c95773993a8b371d9f951983f939) (cherry picked from commit c5b762b011dfe7febfb307487f734419b7c75c2c) --- .../plugins/gradle/action/GradleDownloadSourcesAction.kt | 5 +++++ .../dependency/analyzer/GradleDependencyAnalyzerAction.kt | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleDownloadSourcesAction.kt b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleDownloadSourcesAction.kt index 88ecb8efdfde..4e1489f71344 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleDownloadSourcesAction.kt +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleDownloadSourcesAction.kt @@ -1,4 +1,7 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// +// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru). +// Any modifications are available on the same license terms as the original source code. package org.jetbrains.plugins.gradle.action import com.intellij.openapi.actionSystem.AnActionEvent @@ -32,4 +35,6 @@ class GradleDownloadSourcesAction : ExternalSystemAction() { } } } + + override fun isVisible(e: AnActionEvent) = getSystemId(e) == GradleConstants.SYSTEM_ID } \ No newline at end of file diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/dependency/analyzer/GradleDependencyAnalyzerAction.kt b/plugins/gradle/src/org/jetbrains/plugins/gradle/dependency/analyzer/GradleDependencyAnalyzerAction.kt index b540bb970742..1d433de48260 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/dependency/analyzer/GradleDependencyAnalyzerAction.kt +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/dependency/analyzer/GradleDependencyAnalyzerAction.kt @@ -1,4 +1,7 @@ // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// +// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru). +// Any modifications are available on the same license terms as the original source code. package org.jetbrains.plugins.gradle.dependency.analyzer import com.intellij.openapi.actionSystem.AnActionEvent @@ -63,7 +66,9 @@ class ToolbarDependencyAnalyzerAction : DependencyAnalyzerAction() { override fun getSystemId(e: AnActionEvent) = GradleConstants.SYSTEM_ID - override fun isEnabledAndVisible(e: AnActionEvent) = true + override fun isEnabledAndVisible(e: AnActionEvent): Boolean { + return e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID) == GradleConstants.SYSTEM_ID + } override fun setSelectedState(view: DependencyAnalyzerView, e: AnActionEvent) { viewAction.setSelectedState(view, e)