Class TerminalUIBuilder
java.lang.Object
org.springframework.shell.component.view.TerminalUIBuilder
Builder that can be used to configure and create a
TerminalUI.-
Constructor Summary
ConstructorsConstructorDescriptionTerminalUIBuilder(org.jline.terminal.Terminal terminal, Set<TerminalUICustomizer> customizers, ThemeResolver themeResolver, String themeName) Create a newTerminalUIBuilderinstance.TerminalUIBuilder(org.jline.terminal.Terminal terminal, TerminalUICustomizer... customizers) Create a newTerminalUIBuilderinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newTerminalUIinstance and configure it using this builder.<T extends TerminalUI>
Tconfigure(T terminalUI) Configure the providedTerminalUIinstance using this builder.customizers(Collection<? extends TerminalUICustomizer> customizers) Set theTerminalUICustomizerthat should be applied to theTerminalUI.Sets atheme nameforTerminalUIto build.themeResolver(ThemeResolver themeResolver) Sets aThemeResolverforTerminalUIto build.
-
Constructor Details
-
TerminalUIBuilder
Create a newTerminalUIBuilderinstance.- Parameters:
terminal- the terminalcustomizers- anyTerminalUICustomizersthat should be applied when theTerminalUIis built
-
TerminalUIBuilder
public TerminalUIBuilder(org.jline.terminal.Terminal terminal, Set<TerminalUICustomizer> customizers, ThemeResolver themeResolver, String themeName) Create a newTerminalUIBuilderinstance.- Parameters:
terminal- the terminalcustomizers- anyTerminalUICustomizersthat should be applied when theTerminalUIis builtthemeResolver- the theme resolverthemeName- the theme name
-
-
Method Details
-
themeResolver
Sets aThemeResolverforTerminalUIto build.- Parameters:
themeResolver- the theme resolver- Returns:
- a new builder instance
-
themeName
Sets atheme nameforTerminalUIto build.- Parameters:
themeName- the theme name- Returns:
- a new builder instance
-
customizers
Set theTerminalUICustomizerthat should be applied to theTerminalUI. Customizers are applied in the order that they were added after builder configuration has been applied. Setting this value will replace any previously configured customizers.- Parameters:
customizers- the customizers to set- Returns:
- a new builder instance
-
build
Build a newTerminalUIinstance and configure it using this builder.- Returns:
- a configured
TerminalUIinstance.
-
configure
Configure the providedTerminalUIinstance using this builder.- Type Parameters:
T- the type of terminal ui- Parameters:
terminalUI- theTerminalUIto configure- Returns:
- the terminal ui instance
-