- All Superinterfaces:
Action,ActionListener,EventListener
- All Known Subinterfaces:
CommandControl,Controls,ToggleControl
A beefed up Action.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA command interface, allowing Controls based onActionEvents.static interfaceControl.Builder<C extends Control,B extends Control.Builder<C, B>> A builder for Controlstatic interfaceProvides control builders.static interfaceA command interface, allowing Controls based on method references -
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandControlactionControl(Control.ActionCommand actionCommand) Creates a control based on aControl.ActionCommandstatic Control.BuilderFactorybuilder()static CommandControlcommandControl(Control.Command command) Creates a control based on aControl.Command<C extends Control,B extends Control.Builder<C, B>>
Control.Builder<C,B> copy()Returns a newControl.Builderinstance, based on a copy of this control.is.codion.common.state.StateObserverenabled()font()keys()mnemonic()name()voidsetEnabled(boolean enabled) Unsupported, the enabled state of Controls is based on theirenabledstate observerstatic ToggleControltoggleControl(is.codion.common.state.State state) Creates a new ToggleControl based on the given statestatic ToggleControltoggleControl(is.codion.common.value.Value<Boolean> value) Creates a new ToggleControl based on the given valueMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListenerMethods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Method Details
-
description
- Returns:
- the description or an empty Optional if none is available
-
name
- Returns:
- the name or an empty Optional if none is available
-
enabled
is.codion.common.state.StateObserver enabled()- Returns:
- a StateObserver indicating whether this Control is enabled
-
mnemonic
OptionalInt mnemonic()- Returns:
- the mnemonic or an empty Optional if none is available
-
keyStroke
- Returns:
- the KeyStroke associated with this Control or an empty Optional if none is available
-
smallIcon
- Returns:
- the small icon or an empty Optional if none is available
-
largeIcon
- Returns:
- the large icon or an empty Optional if none is available
-
background
- Returns:
- the background color or an empty Optional if none is available
-
foreground
- Returns:
- the foreground color or an empty Optional if none is available
-
font
- Returns:
- the font or an empty Optional if none is available
-
keys
Collection<String> keys()- Returns:
- the keys for values that have been set for this control
- See Also:
-
setEnabled
void setEnabled(boolean enabled) Unsupported, the enabled state of Controls is based on theirenabledstate observer- Specified by:
setEnabledin interfaceAction- Parameters:
enabled- the enabled status- Throws:
UnsupportedOperationException- always- See Also:
-
copy
Returns a newControl.Builderinstance, based on a copy of this control.- Type Parameters:
B- the builder type- Returns:
- a new builder
-
commandControl
Creates a control based on aControl.Command- Parameters:
command- theControl.Commandon which to base the control- Returns:
- a Control for calling the given
Control.Command
-
actionControl
Creates a control based on aControl.ActionCommand- Parameters:
actionCommand- theControl.ActionCommandon which to base the control- Returns:
- a Control for calling the given
Control.Command
-
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
- Returns:
- a new Control
Control.BuilderFactoryinstance
-