Class TerminalUIBuilder
java.lang.Object
org.springframework.shell.component.view.TerminalUIBuilder
Builder that can be used to configure and create a
TerminalUI
.-
Constructor Summary
ConstructorDescriptionTerminalUIBuilder
(org.jline.terminal.Terminal terminal, Set<TerminalUICustomizer> customizers, ThemeResolver themeResolver, String themeName) Create a newTerminalUIBuilder
instance.TerminalUIBuilder
(org.jline.terminal.Terminal terminal, TerminalUICustomizer... customizers) Create a newTerminalUIBuilder
instance. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a newTerminalUI
instance and configure it using this builder.<T extends TerminalUI>
Tconfigure
(T terminalUI) Configure the providedTerminalUI
instance using this builder.customizers
(Collection<? extends TerminalUICustomizer> customizers) Set theTerminalUICustomizer
that should be applied to theTerminalUI
.Sets atheme name
forTerminalUI
to build.themeResolver
(ThemeResolver themeResolver) Sets aThemeResolver
forTerminalUI
to build.
-
Constructor Details
-
TerminalUIBuilder
Create a newTerminalUIBuilder
instance.- Parameters:
terminal
- the terminalcustomizers
- anyTerminalUICustomizers
that should be applied when theTerminalUI
is built
-
TerminalUIBuilder
public TerminalUIBuilder(org.jline.terminal.Terminal terminal, Set<TerminalUICustomizer> customizers, ThemeResolver themeResolver, String themeName) Create a newTerminalUIBuilder
instance.- Parameters:
terminal
- the terminalcustomizers
- anyTerminalUICustomizers
that should be applied when theTerminalUI
is builtthemeResolver
- the theme resolverthemeName
- the theme name
-
-
Method Details
-
themeResolver
Sets aThemeResolver
forTerminalUI
to build.- Parameters:
themeResolver
- the theme resolver- Returns:
- a new builder instance
-
themeName
Sets atheme name
forTerminalUI
to build.- Parameters:
themeName
- the theme name- Returns:
- a new builder instance
-
customizers
Set theTerminalUICustomizer
that 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 newTerminalUI
instance and configure it using this builder.- Returns:
- a configured
TerminalUI
instance.
-
configure
Configure the providedTerminalUI
instance using this builder.- Type Parameters:
T
- the type of terminal ui- Parameters:
terminalUI
- theTerminalUI
to configure- Returns:
- the terminal ui instance
-