Module is.codion.swing.common.ui
Interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>
- Type Parameters:
C
- the Control typeB
- the builder type
- All Known Subinterfaces:
CommandControl.CommandControlBuilder
,Controls.ControlsBuilder
,ToggleControl.ToggleControlBuilder
- Enclosing interface:
- Control
public static interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>
A builder for Control
-
Method Summary
Modifier and TypeMethodDescriptionbackground
(Color background) build()
description
(String description) enabled
(StateObserver enabled) foreground
(Color foreground) mnemonic
(int mnemonic) Note that any values added will overwrite the property, if already present, i.e.
-
Method Details
-
name
- Parameters:
name
- the name of 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
-
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
-