[IFT] Refactor: extract getCallBackActionId to Utils

GitOrigin-RevId: 798a1d1aaca11f9e5c207d9ea20b01867b91eb32
This commit is contained in:
Konstantin Hudyakov
2023-09-27 13:21:00 +00:00
committed by intellij-monorepo-bot
parent 428ce848ab
commit b3315624bb
3 changed files with 5 additions and 10 deletions
@@ -305,11 +305,6 @@ class JavaOnboardingTourLesson : KLesson("java.onboarding", JavaLessonsBundle.me
return JavaProjectUtil.getEffectiveJdk(project)?.let { JavaSdk.getInstance().getVersionString(it) } ?: "none"
}
private fun getCallBackActionId(@Suppress("SameParameterValue") actionId: String): String {
val action = getActionById(actionId)
return LearningUiManager.addCallback { invokeActionForFocusContext(action) }
}
private fun LessonContext.debugTasks() {
clearBreakpoints()
@@ -155,6 +155,11 @@ fun invokeActionForFocusContext(action: AnAction) {
}
}
fun getCallBackActionId(actionId: String): String {
val action = getActionById(actionId)
return LearningUiManager.addCallback { invokeActionForFocusContext(action) }
}
fun openLinkInBrowser(link: String) {
val desktop = if (Desktop.isDesktopSupported()) Desktop.getDesktop() else null
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
@@ -216,11 +216,6 @@ class PythonOnboardingTourLesson :
}
}
private fun getCallBackActionId(@Suppress("SameParameterValue") actionId: String): String {
val action = getActionById(actionId)
return LearningUiManager.addCallback { invokeActionForFocusContext(action) }
}
private fun LessonContext.debugTasks() {
clearBreakpoints()