IJPL-188586 toolbox: respect the 'canOpenProject' flag

GitOrigin-RevId: 8c10f150cb5447c8f27474cae5bbfd0ceb26a913
This commit is contained in:
Aleksey Pivovarov
2025-06-18 19:55:59 +00:00
committed by intellij-monorepo-bot
parent 882cbc3160
commit 9d2efbcf02
2 changed files with 8 additions and 1 deletions
@@ -38,7 +38,10 @@ class OpenSelectedProjectsAction : RecentProjectsWelcomeScreenActionBase() {
}
if (ActionPlaces.WELCOME_SCREEN == event.place) {
presentation.isEnabledAndVisible = items.all { item -> item is RecentProjectItem || item is ProjectsGroupItem || item is ProviderRecentProjectItem }
presentation.isEnabledAndVisible = items.all { item ->
item is RecentProjectItem || item is ProjectsGroupItem ||
item is ProviderRecentProjectItem && item.canOpenProject()
}
when {
items.size == 1 && items.first() is ProjectsGroupItem -> presentation.setText(
IdeBundle.messagePointer("action.presentation.OpenSelectedProjectsAction.text.open.all.projects.in.group")
@@ -158,6 +158,10 @@ internal data class ProviderRecentProjectItem(
val progressText: String? get() = recentProject.status.progressText
val additionalActions: List<AnAction> get() = recentProject.additionalActions
fun canOpenProject() : Boolean {
return recentProject.canOpenProject()
}
fun openProject(actionEvent: AnActionEvent) {
recentProject.openProject(actionEvent)
}