Package nz.org.riskscape.picocli
Class CommandLine.Help.ColorScheme.Builder
java.lang.Object
nz.org.riskscape.picocli.CommandLine.Help.ColorScheme.Builder
- Enclosing class:
- CommandLine.Help.ColorScheme
Builder class to create
ColorScheme
instances.- Since:
- 4.0
-
Constructor Summary
ConstructorDescriptionBuilder()
Constructs an empty color scheme builder with Ansi.AUTO.Builder
(CommandLine.Help.Ansi ansi) Constructs an empty color scheme builder with the specified Ansi value.Builder
(CommandLine.Help.ColorScheme existing) Constructs a color scheme builder with all attributes copied from the specified color scheme. -
Method Summary
Modifier and TypeMethodDescriptionansi()
Returns theAnsi
setting of this color scheme builder.ansi
(CommandLine.Help.Ansi ansi) Returns theAnsi
setting of this color scheme builder.Replaces colors and styles in this scheme builder with ones specified in system properties, and returns this builder.build()
Creates and returns a newColorScheme
with the values configured on this builder.commands
(CommandLine.Help.Ansi.IStyle... styles) Adds the specified styles to the registered styles for commands in this color scheme builder and returns this builder.Returns the registered styles for commands in this color scheme builder.optionParams
(CommandLine.Help.Ansi.IStyle... styles) Adds the specified styles to the registered styles for option parameters in this color scheme builder and returns this builder.Returns the registered styles for option parameters in this color scheme builder.options
(CommandLine.Help.Ansi.IStyle... styles) Adds the specified styles to the registered styles for options in this color scheme and returns this color scheme.Returns the registered styles for options in this color scheme builder.parameters
(CommandLine.Help.Ansi.IStyle... styles) Adds the specified styles to the registered styles for positional parameters in this color scheme builder and returns this builder.Returns the registered styles for positional parameters in this color scheme builder.
-
Constructor Details
-
Builder
public Builder()Constructs an empty color scheme builder with Ansi.AUTO. -
Builder
Constructs an empty color scheme builder with the specified Ansi value. -
Builder
Constructs a color scheme builder with all attributes copied from the specified color scheme.
-
-
Method Details
-
ansi
Returns theAnsi
setting of this color scheme builder. -
ansi
Returns theAnsi
setting of this color scheme builder. -
commandStyles
Returns the registered styles for commands in this color scheme builder. -
optionStyles
Returns the registered styles for options in this color scheme builder. -
parameterStyles
Returns the registered styles for positional parameters in this color scheme builder. -
optionParamStyles
Returns the registered styles for option parameters in this color scheme builder. -
commands
Adds the specified styles to the registered styles for commands in this color scheme builder and returns this builder.- Parameters:
styles
- the styles to add to the registered styles for commands in this color scheme builder- Returns:
- this color scheme builder to enable method chaining for a more fluent API
-
options
Adds the specified styles to the registered styles for options in this color scheme and returns this color scheme.- Parameters:
styles
- the styles to add to registered the styles for options in this color scheme builder- Returns:
- this color scheme builder to enable method chaining for a more fluent API
-
parameters
Adds the specified styles to the registered styles for positional parameters in this color scheme builder and returns this builder.- Parameters:
styles
- the styles to add to registered the styles for parameters in this color scheme builder- Returns:
- this color scheme builder to enable method chaining for a more fluent API
-
optionParams
Adds the specified styles to the registered styles for option parameters in this color scheme builder and returns this builder.- Parameters:
styles
- the styles to add to the registered styles for option parameters in this color scheme builder- Returns:
- this color scheme builder to enable method chaining for a more fluent API
-
applySystemProperties
Replaces colors and styles in this scheme builder with ones specified in system properties, and returns this builder. Supported property names:picocli.color.commands
picocli.color.options
picocli.color.parameters
picocli.color.optionParams
Property values can be anything that
CommandLine.Help.Ansi.Style.parse(String)
can handle.- Returns:
- this ColorScheme builder
-
build
Creates and returns a newColorScheme
with the values configured on this builder.
-