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)