Module is.codion.swing.common.ui
Interface ControlBuilder<C extends Control,B extends ControlBuilder<C,B>>
- Type Parameters:
C- the Control typeB- the builder type
- All Superinterfaces:
Supplier<C>
- All Known Subinterfaces:
CommandControl.CommandControlBuilder,ControlsBuilder,ToggleControlBuilder
public interface ControlBuilder<C extends Control,B extends ControlBuilder<C,B>>
extends Supplier<C>
A builder for Control
-
Method Summary
Modifier and TypeMethodDescriptionbackground(@Nullable Color background) build()description(@Nullable String description) enabled(@Nullable ObservableState enabled) foreground(@Nullable Color foreground) default Cget()icon(@Nullable ControlIcon icon) Sets both the small and large icons.mnemonic(int mnemonic) Note that any values added will overwrite the property, if already present, i.e.
-
Method Details
-
caption
- Parameters:
caption- the caption for the control- Returns:
- this Builder instance
-
enabled
- Parameters:
enabled- the state observer which controls the enabled state of the control- Returns:
- this Builder instance
-
mnemonic
- Parameters:
mnemonic- the control mnemonic- Returns:
- this Builder instance
-
icon
Sets both the small and large icons.- Parameters:
icon- the control icon- Returns:
- this Builder instance
- See Also:
-
smallIcon
- Parameters:
smallIcon- the small control icon- Returns:
- this Builder instance
-
largeIcon
- Parameters:
largeIcon- the large control icon- Returns:
- this Builder instance
-
description
- Parameters:
description- a string describing the control- Returns:
- this Builder instance
-
foreground
- Parameters:
foreground- the foreground color- Returns:
- this Builder instance
-
background
- Parameters:
background- the background color- Returns:
- this Builder instance
-
font
- Parameters:
font- the font- Returns:
- this Builder instance
-
keyStroke
- Parameters:
keyStroke- the keystroke to associate with the control- Returns:
- this Builder instance
-
value
Note that any values added will overwrite the property, if already present, i.e. setting the 'SmallIcon' value via this method will overwrite the one set viasmallIcon(Icon).- Parameters:
key- the keyvalue- the value- Returns:
- this builder
- See Also:
-
build
C build()- Returns:
- a new Control instance
- Throws:
IllegalStateException- in case no command has been set
-
get
-