Class ConfirmationInput
java.lang.Object
org.springframework.shell.component.support.AbstractComponent<C>
org.springframework.shell.component.support.AbstractTextComponent<Boolean,ConfirmationInput.ConfirmationInputContext>
org.springframework.shell.component.ConfirmationInput
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ResourceLoaderAware
public class ConfirmationInput
extends AbstractTextComponent<Boolean,ConfirmationInput.ConfirmationInputContext>
Component for a confirmation question.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.shell.component.support.AbstractTextComponent
AbstractTextComponent.BaseTextComponentContext<T,
C extends AbstractTextComponent.TextComponentContext<T, C>>, AbstractTextComponent.TextComponentContext<T, C extends AbstractTextComponent.TextComponentContext<T, C>> -
Field Summary
Fields inherited from class org.springframework.shell.component.support.AbstractComponent
OPERATION_BACKSPACE, OPERATION_CHAR, OPERATION_DOWN, OPERATION_EXIT, OPERATION_SELECT, OPERATION_UNICODE, OPERATION_UP
-
Constructor Summary
ConstructorDescriptionConfirmationInput
(org.jline.terminal.Terminal terminal) ConfirmationInput
(org.jline.terminal.Terminal terminal, String name) ConfirmationInput
(org.jline.terminal.Terminal terminal, String name, boolean defaultValue) ConfirmationInput
(org.jline.terminal.Terminal terminal, String name, boolean defaultValue, Function<ConfirmationInput.ConfirmationInputContext, List<org.jline.utils.AttributedString>> renderer) -
Method Summary
Modifier and TypeMethodDescriptiongetThisContext
(ComponentContext<?> context) Gets a real component context using common this trick.protected boolean
read
(org.jline.keymap.BindingReader bindingReader, org.jline.keymap.KeyMap<String> keyMap, ConfirmationInput.ConfirmationInputContext context) Read input.Methods inherited from class org.springframework.shell.component.support.AbstractTextComponent
bindKeyMap, getName, runInternal
Methods inherited from class org.springframework.shell.component.support.AbstractComponent
addPostRunHandler, addPreRunHandler, getTemplateExecutor, getTerminal, hasTty, loop, render, renderTemplateResource, run, runPostRunHandlers, runPreRunHandlers, setPrintResults, setRenderer, setResourceLoader, setTemplateExecutor, setTemplateLocation
-
Constructor Details
-
ConfirmationInput
public ConfirmationInput(org.jline.terminal.Terminal terminal) -
ConfirmationInput
-
ConfirmationInput
-
ConfirmationInput
public ConfirmationInput(org.jline.terminal.Terminal terminal, String name, boolean defaultValue, Function<ConfirmationInput.ConfirmationInputContext, List<org.jline.utils.AttributedString>> renderer)
-
-
Method Details
-
getThisContext
Description copied from class:AbstractComponent
Gets a real component context using common this trick.- Specified by:
getThisContext
in classAbstractComponent<ConfirmationInput.ConfirmationInputContext>
- Parameters:
context
- the context- Returns:
- a component context
-
read
protected boolean read(org.jline.keymap.BindingReader bindingReader, org.jline.keymap.KeyMap<String> keyMap, ConfirmationInput.ConfirmationInputContext context) Description copied from class:AbstractComponent
Read input.- Specified by:
read
in classAbstractComponent<ConfirmationInput.ConfirmationInputContext>
- Parameters:
bindingReader
- the binding readerkeyMap
- the key mapcontext
- the context- Returns:
- true if read is complete, false to stop
-