diff --git a/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/configurables/SettingsConfigurable.kt b/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/configurables/SettingsConfigurable.kt index 0757232..702288e 100644 --- a/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/configurables/SettingsConfigurable.kt +++ b/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/configurables/SettingsConfigurable.kt @@ -1,6 +1,7 @@ package com.github.blarc.gitlab.template.lint.plugin.settings.configurables import com.github.blarc.gitlab.template.lint.plugin.GitlabLintBundle +import com.github.blarc.gitlab.template.lint.plugin.extensions.emptyText import com.github.blarc.gitlab.template.lint.plugin.extensions.notBlank import com.github.blarc.gitlab.template.lint.plugin.extensions.reportBugLink import com.github.blarc.gitlab.template.lint.plugin.settings.AppSettings @@ -51,6 +52,10 @@ class SettingsConfigurable(val project: Project) : .bindText(project.service()::remote) .validationOnApply { notBlank(it.text) } .align(Align.FILL) + .resizableColumn() + .emptyText(GitlabLintBundle.message("settings.remote.empty-text")) + + contextHelp(GitlabLintBundle.message("settings.remote.comment")) } row { label(GitlabLintBundle.message("settings.fallback-branch")) @@ -58,6 +63,8 @@ class SettingsConfigurable(val project: Project) : textField() .bindText(project.service()::fallbackBranch) .align(Align.FILL) + .resizableColumn() + .emptyText(GitlabLintBundle.message("settings.fallback-branch.empty-text")) contextHelp(GitlabLintBundle.message("settings.fallback-branch.comment")) } diff --git a/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/gitlabUrlToken/GitlabUrlTokenTable.kt b/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/gitlabUrlToken/GitlabUrlTokenTable.kt index 1993be7..9828e37 100644 --- a/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/gitlabUrlToken/GitlabUrlTokenTable.kt +++ b/src/main/kotlin/com/github/blarc/gitlab/template/lint/plugin/settings/gitlabUrlToken/GitlabUrlTokenTable.kt @@ -2,6 +2,7 @@ package com.github.blarc.gitlab.template.lint.plugin.settings.gitlabUrlToken; import com.github.blarc.gitlab.template.lint.plugin.GitlabLintBundle.message import com.github.blarc.gitlab.template.lint.plugin.extensions.createColumn +import com.github.blarc.gitlab.template.lint.plugin.extensions.emptyText import com.github.blarc.gitlab.template.lint.plugin.extensions.notBlank import com.github.blarc.gitlab.template.lint.plugin.extensions.replaceAt import com.github.blarc.gitlab.template.lint.plugin.gitlab.Gitlab @@ -23,7 +24,6 @@ import java.awt.event.ActionEvent import java.net.URL import javax.swing.Action import javax.swing.JLabel -import javax.swing.JTextField import javax.swing.ListSelectionModel.SINGLE_SELECTION class GitlabUrlTokenTable(val project: Project) { @@ -102,7 +102,7 @@ class GitlabUrlTokenTable(val project: Project) { DialogWrapper(true) { var gitlabUrlToken = newGitlabUrlToken ?: GitlabUrlToken() val gitlabUrlTextField = JBTextField() - val gitlabTokenTextField = JTextField() + val gitlabTokenTextField = JBTextField() val verifyLabel = JLabel() init { @@ -125,12 +125,14 @@ class GitlabUrlTokenTable(val project: Project) { .focused() .validationOnApply { notBlank(it.text) } .comment(message("settings.gitlab-url-token.gitlab-url.comment")) + .emptyText(message("settings.gitlab-url-token.gitlab-url.empty-text")) } row(message("settings.gitlab-url-token.gitlab-token")) { cell(gitlabTokenTextField) .align(Align.FILL) .bindText({ gitlabUrlToken.gitlabToken.orEmpty() }, { gitlabUrlToken.gitlabToken = it }) .validationOnApply { notBlank(it.text) } + .emptyText(message("settings.gitlab-url-token.gitlab-token.empty-text")) .comment(message("settings.gitlab-url-token.gitlab-token.comment"), action= { val host: String = try { val uri = URL(gitlabUrlTextField.text).toURI() diff --git a/src/main/resources/messages/MyBundle.properties b/src/main/resources/messages/MyBundle.properties index 46e9b40..9de0f12 100644 --- a/src/main/resources/messages/MyBundle.properties +++ b/src/main/resources/messages/MyBundle.properties @@ -111,4 +111,9 @@ settings.globs.exclusions.title=Exclusions settings.fallback-branch=Fallback branch settings.fallback-branch.comment=Git branch that is used for linting, if the current branch does not exist on remote. \ Keep in mind that linting result might not be accurate when fallback branch is used. +settings.fallback-branch.empty-text=main +settings.remote.empty-text=origin +settings.gitlab-url-token.gitlab-url.empty-text=https://gitlab.example.com/api/v4 +settings.gitlab-url-token.gitlab-token.empty-text=glpat-c67zrFe81alZuEstHCgL +settings.remote.comment=Git remote that is used for linting.