override fun updateAction()

in core/src/main/kotlin/com/jetbrains/aspire/actions/dashboard/resource/ResourceCommandAction.kt [29:44]


    override fun updateAction(event: AnActionEvent, resourceService: AspireResource, project: Project) {
        val command = findCommand(resourceService)
        if (command == null || command.state == ResourceCommandState.Hidden) {
            event.presentation.isEnabledAndVisible = false
            return
        }

        val resourceState = checkResourceState(resourceService)
        if (!resourceState) {
            event.presentation.isEnabledAndVisible = false
            return
        }

        event.presentation.isVisible = true
        event.presentation.isEnabled = command.state == ResourceCommandState.Enabled
    }