- All Superinterfaces:
Action
,ActionListener
,EventListener
- All Known Subinterfaces:
CommandControl
,Controls
,ToggleControl
A beefed up Action.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A command interface, allowing Controls based onActionEvent
s.static interface
Control.Builder<C extends Control,
B extends Control.Builder<C, B>> A builder for Controlstatic interface
Provides control builders.static interface
A 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 CommandControl
action
(Control.ActionCommand actionCommand) Creates a control based on aControl.ActionCommand
static Control.BuilderFactory
builder()
static CommandControl
command
(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.Builder
instance, based on a copy of this control.enabled()
font()
keys()
mnemonic()
name()
void
setEnabled
(boolean enabled) Unsupported, the enabled state of Controls is based on theirenabled
state observerstatic ToggleControl
Creates a new ToggleControl based on the given statestatic ToggleControl
Creates a new ToggleControl based on the given valueMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener
Methods 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
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 theirenabled
state observer- Specified by:
setEnabled
in interfaceAction
- Parameters:
enabled
- the enabled status- Throws:
UnsupportedOperationException
- always- See Also:
-
copy
Returns a newControl.Builder
instance, based on a copy of this control.- Type Parameters:
C
- the control typeB
- the builder type- Returns:
- a new builder
-
command
Creates a control based on aControl.Command
- Parameters:
command
- theControl.Command
on which to base the control- Returns:
- a Control for calling the given
Control.Command
-
action
Creates a control based on aControl.ActionCommand
- Parameters:
actionCommand
- theControl.ActionCommand
on which to base the control- Returns:
- a Control for calling the given
Control.Command
-
toggle
Creates a new ToggleControl based on the given value- Parameters:
value
- the value- Returns:
- a new ToggleControl
-
toggle
Creates a new ToggleControl based on the given state- Parameters:
state
- the state- Returns:
- a new ToggleControl
-
builder
- Returns:
- a new Control
Control.BuilderFactory
instance
-