override fun actionPerformed()

in plugin/src/main/kotlin/org/jetbrains/downloadThis/DownloadSelectedLink.kt [32:41]


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

        val selectedText = event.getData(CommonDataKeys.CARET)?.selectedText

        if (selectedText != null) {
            DownloadLauncher.runDownloadInBackground(currentProject, selectedText, destinationDir)
        }
    }