Class MultiItemSelector<T,I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>
java.lang.Object
org.springframework.shell.component.support.AbstractComponent<C>
org.springframework.shell.component.support.AbstractSelectorComponent<T,MultiItemSelector.MultiItemSelectorContext<T,I>,I>
org.springframework.shell.component.MultiItemSelector<T,I>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ResourceLoaderAware
public class MultiItemSelector<T,I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>
extends AbstractSelectorComponent<T,MultiItemSelector.MultiItemSelectorContext<T,I>,I>
Component able to pick multiple items.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.shell.component.support.AbstractSelectorComponent
AbstractSelectorComponent.BaseSelectorComponentContext<T,
I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>>, AbstractSelectorComponent.ItemState<I extends Matchable>, AbstractSelectorComponent.SelectorComponentContext<T, I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> -
Field Summary
Fields inherited from class org.springframework.shell.component.support.AbstractSelectorComponent
name
Fields inherited from class org.springframework.shell.component.support.AbstractComponent
OPERATION_BACKSPACE, OPERATION_CHAR, OPERATION_DOWN, OPERATION_EXIT, OPERATION_SELECT, OPERATION_UP
-
Constructor Summary
ConstructorDescriptionMultiItemSelector
(org.jline.terminal.Terminal terminal, List<I> items, String name, Comparator<I> comparator) -
Method Summary
Modifier and TypeMethodDescriptiongetThisContext
(ComponentContext<?> context) Gets a real component context using common this trick.protected MultiItemSelector.MultiItemSelectorContext<T,
I> Run internal logic called from public run method.Methods inherited from class org.springframework.shell.component.support.AbstractSelectorComponent
bindKeyMap, getItemMapper, getItems, read, setDefaultExpose, setItemMapper, setMaxItems
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
-
MultiItemSelector
public MultiItemSelector(org.jline.terminal.Terminal terminal, List<I> items, String name, Comparator<I> comparator)
-
-
Method Details
-
getThisContext
Description copied from class:AbstractComponent
Gets a real component context using common this trick.- Specified by:
getThisContext
in classAbstractComponent<MultiItemSelector.MultiItemSelectorContext<T,
I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>> - Parameters:
context
- the context- Returns:
- a component context
-
runInternal
protected MultiItemSelector.MultiItemSelectorContext<T,I> runInternal(MultiItemSelector.MultiItemSelectorContext<T, I> context) Description copied from class:AbstractComponent
Run internal logic called from public run method.- Overrides:
runInternal
in classAbstractSelectorComponent<T,
MultiItemSelector.MultiItemSelectorContext<T, I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>, I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>> - Parameters:
context
- the context- Returns:
- a context
-