Last active
May 1, 2022 18:58
-
-
Save rubenquadros/61d774d435e1969bfe04136d7b88a757 to your computer and use it in GitHub Desktop.
Creating the notification to be displayed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun createPanel( | |
psiFile: PsiFile, | |
project: Project, | |
name: String, | |
onAddClick: () -> Unit, | |
onIgnoreClick: () -> Unit | |
): EditorNotificationPanel? { | |
return if (isErrorHighlighted(psiFile, project)) { | |
val panel = EditorNotificationPanel() | |
panel.text("Add SerializedName annotation to $name params?") | |
panel.createActionLabel("Add annotation") { onAddClick.invoke() } | |
panel.createActionLabel("Ignore") { onIgnoreClick.invoke() } | |
panel | |
} else { | |
null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment