override fun actionPerformed()

in plugin/src/main/kotlin/org/jetbrains/downloadThis/DownloadThisLink.kt [34:45]


    override fun actionPerformed(event: AnActionEvent) {
        val currentProject = event.project ?: return
        val destinationDir = PathSelector.getDestinationDir(currentProject)

        val data = event.getData(CommonDataKeys.NAVIGATABLE)

        if (data is PsiNamedElement && data.isWebReference) {
            val url = data.name ?: return

            DownloadLauncher.runDownloadInBackground(currentProject, url, destinationDir)
        }
    }