Skip to content

Commit

Permalink
-Updated the divider validation, don't save entered text values if th…
Browse files Browse the repository at this point in the history
…e divider is selected
  • Loading branch information
GrahamParvinkarimi committed Sep 17, 2024
1 parent 4fbea03 commit 2bdf950
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/org/jetbrains/plugins/template/MyDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,19 @@ class MyDialog(val myMenuItem: MyMenuItem, val onSubmit: (MyMenuItem) -> Unit) :

override fun doOKAction() {
panel.apply() // needed to set
myMenuItem.label = if (!myMenuItem.isDivider) _title.component.text else ""
myMenuItem.url = if (!myMenuItem.isDivider) _url.component.text else ""
myMenuItem.isDivider = _divider.component.isSelected
myMenuItem.label = if (!myMenuItem.isDivider){
_title.component.text
} else {
_title.component.text = ""
""
}
myMenuItem.url = if (!myMenuItem.isDivider) {
_url.component.text
} else {
_url.component.text = ""
""
}
onSubmit(myMenuItem)
super.doOKAction()
}
Expand Down

0 comments on commit 2bdf950

Please sign in to comment.