Skip to content

Commit

Permalink
ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ellizio committed Mar 18, 2024
1 parent 279d207 commit 61d3167
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.DialogPanel
import com.intellij.ui.components.JBTabbedPane
import com.intellij.ui.dsl.builder.*
import com.jetbrains.rider.plugins.odatacliui.extensions.emptyText
import com.jetbrains.rider.plugins.odatacliui.models.CliDialogModel
import javax.swing.JComponent

Expand Down Expand Up @@ -52,31 +53,35 @@ class CliDialog(private val model: CliDialogModel) : DialogWrapper(false) {
row("--file-name") {
textField()
.align(AlignX.FILL)
.comment("The name of the generated file. If not provided, then the default name 'Reference.cs' is used", Int.MAX_VALUE)
.emptyText("Default: Reference.cs")
.comment("The name of the generated file")
.bindText(model.fileName)
}
row("--namespace-prefix") {
textField()
.align(AlignX.FILL)
.comment("The namespace of the client code generated. <b>Example: NorthWindService.Client</b> or it could be a name related to the OData endpoint that you are generating code for", Int.MAX_VALUE)
.comment("The namespace of the client code generated")
.bindText(model.namespacePrefix)
}
row("--excluded-operation-imports") {
textField()
.align(AlignX.FILL)
.comment("Comma-separated list of the names of operation imports to exclude from the generated code. <b>Example: ExcludedOperationImport1, ExcludedOperationImport2</b>", Int.MAX_VALUE)
.emptyText("Example: ExcludedOperationImport1, ExcludedOperationImport2")
.comment("Comma-separated list of the names of operation imports to exclude from the generated code")
.bindText(model.excludedOperationImports)
}
row("--excluded-bound-operations") {
textField()
.align(AlignX.FILL)
.comment("Comma-separated list of the names of bound operations to exclude from the generated code. <b>Example: BoundOperation1, BoundOperation2</b>", Int.MAX_VALUE)
.emptyText("Example: BoundOperation1, BoundOperation2")
.comment("Comma-separated list of the names of bound operations to exclude from the generated code")
.bindText(model.excludedBoundOperations)
}
row("--excluded-schema-types") {
textField()
.align(AlignX.FILL)
.comment("Comma-separated list of the names of entity types to exclude from the generated code. <b>Example: EntityType1, EntityType2, EntityType3</b>", Int.MAX_VALUE)
.emptyText("Example: EntityType1, EntityType2, EntityType3")
.comment("Comma-separated list of the names of entity types to exclude from the generated code")
.bindText(model.excludedSchemaTypes)
}
row {
Expand Down Expand Up @@ -109,13 +114,15 @@ class CliDialog(private val model: CliDialogModel) : DialogWrapper(false) {
row("--custom-headers") {
textField()
.align(AlignX.FILL)
.comment("Headers that will get sent along with the request when fetching the metadata document from the service. <b>Format: Header1:HeaderValue, Header2:HeaderValue</b>", Int.MAX_VALUE)
.emptyText("Example: Header1:HeaderValue, Header2:HeaderValue")
.comment("Headers that will get sent along with the request when fetching the metadata document from the service", Int.MAX_VALUE)
.bindText(model.customHeaders)
}
row("--proxy") {
textField()
.align(AlignX.FILL)
.comment("Proxy settings. <b>Format: domain\\\\user:password@SERVER:PORT</b>", Int.MAX_VALUE)
.emptyText("Example: domain\\\\user:password@SERVER:PORT")
.comment("Proxy settings")
.bindText(model.proxy)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.jetbrains.rider.plugins.odatacliui.extensions

import com.intellij.ui.components.JBTextField
import com.intellij.ui.dsl.builder.Cell

fun Cell<JBTextField>.emptyText(text: String): Cell<JBTextField> {
this.component.emptyText.text = text
return this
}

0 comments on commit 61d3167

Please sign in to comment.