Kotlin中编写的Android Studio(Intellij)插件-DialogWrapper如何将数据传递给调用方函数

时间:2019-12-12 12:01:20

标签: kotlin intellij-plugin

实现Android Studio(基于Intellij)插件时,将数据从DialogWrapper传递给调用者的最佳实践是什么?

package com.my.plugin

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent

class MyAction: AnAction() {
   override fun actionPerformed(e: AnActionEvent) {
      // MyDialogWrapper is defined in the package as "class MyDialogWrapper: DialogWrapper(true)"
      if (MyDialogWrapper().showAndGet()) {
         // Do Something after dialog was closed by clicking on the OK button
      }
   }
}

0 个答案:

没有答案