Skip to content

Commit

Permalink
feat: 替换已弃用的 API
Browse files Browse the repository at this point in the history
  • Loading branch information
suiyun39 committed May 9, 2023
1 parent 4adb996 commit 6e3f978
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sh.catx.chooselicense.ui
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.ValidationInfo
import com.intellij.ui.dsl.builder.*
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import sh.catx.chooselicense.license.LICENSE_LIST
import sh.catx.chooselicense.license.License
import java.awt.Component
Expand All @@ -23,24 +22,24 @@ class NewLicenseFileDialog : DialogWrapper(true) {
textField()
.bindText(::author)
.validationOnInput { if (it.text.isNullOrBlank()) ValidationInfo("Author is required", it) else null }
.horizontalAlign(HorizontalAlign.FILL)
.align(Align.FILL)
}
row("Year:") {
textField()
.bindText(::year)
.validationOnInput { if (it.text.isNullOrBlank()) ValidationInfo("Year is required", it) else null }
.horizontalAlign(HorizontalAlign.FILL)
.align(Align.FILL)
}
row("License:") {
comboBox(LICENSE_LIST, LicenseListCellRenderer())
.bindItem(::license.toNullableProperty())
.horizontalAlign(HorizontalAlign.FILL)
.align(Align.FILL)
}
row("FileName:") {
textField()
.bindText(::fileName)
.validationOnInput { if (it.text.isNullOrBlank()) ValidationInfo("FileName is required", it) else null }
.horizontalAlign(HorizontalAlign.FILL)
.align(Align.FILL)
}
}

Expand Down

0 comments on commit 6e3f978

Please sign in to comment.