Class AbstractTextComponent<T,C extends AbstractTextComponent.TextComponentContext<T,C>>
java.lang.Object
org.springframework.shell.component.support.AbstractComponent<C>
org.springframework.shell.component.support.AbstractTextComponent<T,C>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ResourceLoaderAware
- Direct Known Subclasses:
ConfirmationInput
,PathInput
,PathSearch
,StringInput
public abstract class AbstractTextComponent<T,C extends AbstractTextComponent.TextComponentContext<T,C>>
extends AbstractComponent<C>
Base class for components which work on a simple text input.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
AbstractTextComponent.BaseTextComponentContext<T,
C extends AbstractTextComponent.TextComponentContext<T, C>> static interface
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_UP
-
Constructor Summary
ConstructorDescriptionAbstractTextComponent
(org.jline.terminal.Terminal terminal) AbstractTextComponent
(org.jline.terminal.Terminal terminal, String name) AbstractTextComponent
(org.jline.terminal.Terminal terminal, String name, Function<C, List<org.jline.utils.AttributedString>> renderer) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bindKeyMap
(org.jline.keymap.KeyMap<String> keyMap) Bind key map.protected String
getName()
Gets a name.protected C
runInternal
(C context) Run internal logic called from public run method.Methods inherited from class org.springframework.shell.component.support.AbstractComponent
addPostRunHandler, addPreRunHandler, getTemplateExecutor, getTerminal, getThisContext, hasTty, loop, read, render, renderTemplateResource, run, runPostRunHandlers, runPreRunHandlers, setPrintResults, setRenderer, setResourceLoader, setTemplateExecutor, setTemplateLocation
-
Constructor Details
-
AbstractTextComponent
public AbstractTextComponent(org.jline.terminal.Terminal terminal) -
AbstractTextComponent
-
AbstractTextComponent
-
-
Method Details
-
bindKeyMap
Description copied from class:AbstractComponent
Bind key map.- Specified by:
bindKeyMap
in classAbstractComponent<C extends AbstractTextComponent.TextComponentContext<T,
C>>
-
runInternal
Description copied from class:AbstractComponent
Run internal logic called from public run method.- Specified by:
runInternal
in classAbstractComponent<C extends AbstractTextComponent.TextComponentContext<T,
C>> - Parameters:
context
- the context- Returns:
- a context
-
getName
Gets a name.- Returns:
- a name
-