Update docs

This commit is contained in:
Janne Valkealahti
2023-10-06 17:07:16 +01:00
parent 2819c1d367
commit 6f7eac435a
11 changed files with 18 additions and 18 deletions

View File

@@ -0,0 +1,42 @@
[[using-shell-components-ui-stringinput]]
= String Input
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
The string input component asks a user for simple text input, optionally masking values
if the content contains something sensitive. The following listing shows an example:
[source, java, indent=0]
----
include::{snippets}/UiComponentSnippets.java[tag=snippet3]
----
The following image shows typical output from a string input component:
image::component-text-input-1.svg[text input]
The context object is `StringInputContext`. The following table lists its context variables:
[[stringinputcontext-template-variables]]
.StringInputContext Template Variables
|===
|Key |Description
|`defaultValue`
|The default value, if set. Otherwise, null.
|`maskedInput`
|The masked input value
|`maskedResultValue`
|The masked result value
|`maskCharacter`
|The mask character, if set. Otherwise, null.
|`hasMaskCharacter`
|`true` if a mask character is set. Otherwise, false.
|`model`
|The parent context variables (see xref:/components/ui/render.adoc#textcomponentcontext-template-variables[TextComponentContext Template Variables]).
|===