Interface AbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>,C extends AbstractSelectorComponent.SelectorComponentContext<T,I,C>>
- All Superinterfaces:
ComponentContext<C>
- All Known Subinterfaces:
MultiItemSelector.MultiItemSelectorContext<T,,I> SingleItemSelector.SingleItemSelectorContext<T,I>
- All Known Implementing Classes:
AbstractSelectorComponent.BaseSelectorComponentContext
- Enclosing class:
- AbstractSelectorComponent<T,
C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>, I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>
public static interface AbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>,C extends AbstractSelectorComponent.SelectorComponentContext<T,I,C>>
extends ComponentContext<C>
Context interface on a selector component sharing content.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>>
AbstractSelectorComponent.SelectorComponentContext<T,I, C> empty()Creates an emptyAbstractSelectorComponent.SelectorComponentContext.Gets a cursor row.getInput()Gets an input.getItems()Gets an items.Gets an item statesGets an item state view.getName()Gets a name.Gets a result items.booleanisResult()Return if there is a result.voidsetCursorRow(Integer cursorRow) Sets a cursor row.voidSets an input.voidSets an items.voidsetItemStates(List<AbstractSelectorComponent.ItemState<I>> itemStateView) Sets an item states.voidsetItemStateView(List<AbstractSelectorComponent.ItemState<I>> itemStateView) Sets an item state viewvoidSets a namevoidsetResultItems(List<I> items) Sets a result items.Methods inherited from interface org.springframework.shell.component.context.ComponentContext
containsKey, get, get, getTerminalWidth, put, setTerminalWidth, stream, toTemplateModel
-
Method Details
-
getName
String getName()Gets a name.- Returns:
- a name
-
setName
Sets a name- Parameters:
name- the name
-
getInput
String getInput()Gets an input.- Returns:
- an input
-
setInput
Sets an input.- Parameters:
input- the input
-
getItemStates
List<AbstractSelectorComponent.ItemState<I>> getItemStates()Gets an item states- Returns:
- an item states
-
setItemStates
Sets an item states.- Parameters:
itemStateView- the input state
-
getItemStateView
List<AbstractSelectorComponent.ItemState<I>> getItemStateView()Gets an item state view.- Returns:
- an item state view
-
setItemStateView
Sets an item state view- Parameters:
itemStateView- the item state view
-
isResult
boolean isResult()Return if there is a result.- Returns:
- true if context represents result
-
getCursorRow
Integer getCursorRow()Gets a cursor row.- Returns:
- a cursor row.
-
setCursorRow
Sets a cursor row.- Parameters:
cursorRow- the cursor row
-
getItems
Gets an items.- Returns:
- an items
-
setItems
Sets an items.- Parameters:
items- the items
-
getResultItems
Gets a result items.- Returns:
- a result items
-
setResultItems
Sets a result items.- Parameters:
items- the result items
-
empty
static <T,I extends Nameable & Matchable & Itemable<T>, AbstractSelectorComponent.SelectorComponentContext<T,C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> I, empty()C> Creates an emptyAbstractSelectorComponent.SelectorComponentContext.- Type Parameters:
T- the type of context- Returns:
- empty context
-