- All Superinterfaces:
Action
,ActionListener
,Control
,EventListener
A Control for toggling a boolean value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.swing.common.ui.control.Control
Control.ActionCommand, Control.Builder<C extends Control,
B extends Control.Builder<C, B>>, Control.Command -
Field Summary
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Fields inherited from interface is.codion.swing.common.ui.control.Control
BACKGROUND, FONT, FOREGROUND
-
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends Control.Builder<ToggleControl,
B>>
Control.Builder<ToggleControl,B> static <B extends Control.Builder<ToggleControl,
B>>
Control.Builder<ToggleControl,B> <B extends Control.Builder<ToggleControl,
B>>
Control.Builder<ToggleControl,B> Returns aControl.Builder
instance, based on a copy of this control, using the given state.<B extends Control.Builder<ToggleControl,
B>>
Control.Builder<ToggleControl,B> Returns aControl.Builder
instance, based on a copy of this control, using the given value.static ToggleControl
toggleControl
(State state) Creates a new ToggleControl based on the given statestatic ToggleControl
toggleControl
(Value<Boolean> value) Creates a new ToggleControl based on the given valuevalue()
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
Methods inherited from interface is.codion.swing.common.ui.control.Control
copy, copy, copy, enabled, getBackground, getDescription, getFont, getForeground, getKeyStroke, getLargeIcon, getMnemonic, getName, getSmallIcon, setBackground, setDescription, setEnabled, setFont, setForeground, setKeyStroke, setLargeIcon, setMnemonic, setName, setSmallIcon
-
Method Details
-
value
- Returns:
- the value being toggled by this toggle control
-
copy
<B extends Control.Builder<ToggleControl,B>> Control.Builder<ToggleControl,B> copy(Value<Boolean> value) Returns aControl.Builder
instance, based on a copy of this control, using the given value.- Type Parameters:
B
- the builder type- Parameters:
value
- the value for the resulting toggle control- Returns:
- a new builder
-
copy
Returns aControl.Builder
instance, based on a copy of this control, using the given state.- Type Parameters:
B
- the builder type- Parameters:
state
- the state for the resulting toggle control- Returns:
- a new builder
-
toggleControl
Creates a new ToggleControl based on the given value- Parameters:
value
- the value- Returns:
- a new ToggleControl
-
toggleControl
Creates a new ToggleControl based on the given state- Parameters:
state
- the state- Returns:
- a new ToggleControl
-
builder
static <B extends Control.Builder<ToggleControl,B>> Control.Builder<ToggleControl,B> builder(Value<Boolean> value) - Type Parameters:
B
- the builder type- Parameters:
value
- the value to toggle- Returns:
- a new ToggleControl.Builder
-
builder
static <B extends Control.Builder<ToggleControl,B>> Control.Builder<ToggleControl,B> builder(State state) - Type Parameters:
B
- the builder type- Parameters:
state
- the state to toggle- Returns:
- a new ToggleControl.Builder
-