Class PathInput
java.lang.Object
org.springframework.shell.component.support.AbstractComponent<C>
org.springframework.shell.component.support.AbstractTextComponent<Path,PathInput.PathInputContext>
org.springframework.shell.component.PathInput
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ResourceLoaderAware
Component for a simple path input.
-
Nested Class Summary
Nested ClassesNested 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_UP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetThisContext(ComponentContext<?> context) Gets a real component context using common this trick.protected booleanread(org.jline.keymap.BindingReader bindingReader, org.jline.keymap.KeyMap<String> keyMap, PathInput.PathInputContext context) Read input.protected PathresolvePath(String path) Resolves aPathfrom a given rawpath.voidsetPathProvider(Function<String, Path> pathProvider) Sets a path provider.Methods inherited from class org.springframework.shell.component.support.AbstractTextComponent
bindKeyMap, getName, runInternalMethods 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
-
PathInput
public PathInput(org.jline.terminal.Terminal terminal) -
PathInput
-
PathInput
public PathInput(org.jline.terminal.Terminal terminal, String name, Function<PathInput.PathInputContext, List<org.jline.utils.AttributedString>> renderer)
-
-
Method Details
-
getThisContext
Description copied from class:AbstractComponentGets a real component context using common this trick.- Specified by:
getThisContextin classAbstractComponent<PathInput.PathInputContext>- Parameters:
context- the context- Returns:
- a component context
-
read
protected boolean read(org.jline.keymap.BindingReader bindingReader, org.jline.keymap.KeyMap<String> keyMap, PathInput.PathInputContext context) Description copied from class:AbstractComponentRead input.- Specified by:
readin classAbstractComponent<PathInput.PathInputContext>- Parameters:
bindingReader- the binding readerkeyMap- the key mapcontext- the context- Returns:
- true if read is complete, false to stop
-
setPathProvider
Sets a path provider.- Parameters:
pathProvider- the path provider
-
resolvePath
Resolves aPathfrom a given rawpath.- Parameters:
path- the raw path- Returns:
- a resolved path
-