Skip to content

Commit

Permalink
fix binding
Browse files Browse the repository at this point in the history
  • Loading branch information
ellizio committed Mar 26, 2024
1 parent 54449cf commit e3c3453
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/rider/main/kotlin/ru/ellizio/odatacliui/dialogs/CliDialog.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ru.ellizio.odatacliui.dialogs

import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.ui.components.JBTabbedPane
import com.intellij.ui.dsl.builder.*
import ru.ellizio.odatacliui.Constants
Expand All @@ -12,12 +12,21 @@ import ru.ellizio.odatacliui.models.CliDialogModel
import javax.swing.JComponent

class CliDialog(private val model: CliDialogModel) : DialogWrapper(false) {
private lateinit var generationTabPanel: DialogPanel
private lateinit var requestTabPanel: DialogPanel

init {
title = Constants.PLUGIN_NAME
setOKActionEnabled(true)
init()
}

override fun applyFields() {
generationTabPanel.apply()
requestTabPanel.apply()
super.applyFields()
}

override fun setOKActionEnabled(isEnabled: Boolean) {
if (!model.odataCliTool.installed) {
setOKButtonTooltip(UiBundle.text("cli.ok-action-button.tooltip.not-installed"))
Expand Down Expand Up @@ -126,6 +135,9 @@ class CliDialog(private val model: CliDialogModel) : DialogWrapper(false) {
.comment(UiBundle.text("cli.upper-camel-case.comment"), Int.MAX_VALUE)
.bindSelected(model.upperCamelCase)
}
}.apply {
registerValidators(disposable)
generationTabPanel = this
}

private fun buildRequestArgumentsTab(): DialogPanel = panel {
Expand All @@ -143,5 +155,8 @@ class CliDialog(private val model: CliDialogModel) : DialogWrapper(false) {
.comment(UiBundle.text("cli.proxy.comment"))
.bindText(model.proxy)
}
}.apply {
registerValidators(disposable)
requestTabPanel = this
}
}

0 comments on commit e3c3453

Please sign in to comment.