- All Superinterfaces:
Action
,ActionListener
,Control
,EventListener
A collection of controls and separators, note that these can be nested controls.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.swing.common.ui.control.Control
Control.ActionCommand, Control.Command
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Action
A placeholder representing a separator in a Controls instance.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 TypeMethodDescriptionactions()
Adds the given action to this Controls instance, adding a null action has the same effect as addSeparator()Adds all actions found incontrols
to this controls instanceAdds the given action to this Controls instance at the specified index, adding a null action has the same effect as addSeparator()Adds a separator to the end of this controls instanceaddSeparatorAt
(int index) Adds a separator at the given indexstatic Controls.Builder
builder()
static Controls
controls()
Constructs a new Controls instance.static Controls
Constructs a new Controls instance.static Controls
Constructs a new Controls instance.boolean
empty()
get
(int index) boolean
notEmpty()
Removes all actions from this controls instanceint
size()
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
-
Field Details
-
SEPARATOR
A placeholder representing a separator in a Controls instance. All methods throwUnsupportedOperationException
.
-
-
Method Details
-
actions
- Returns:
- an unmodifiable view of the actions in this set
-
add
Adds the given action to this Controls instance, adding a null action has the same effect as addSeparator()- Parameters:
action
- the action to add- Returns:
- this Controls instance
-
addAt
Adds the given action to this Controls instance at the specified index, adding a null action has the same effect as addSeparator()- Parameters:
index
- the indexaction
- the action to add at the specified index- Returns:
- this Controls instance
-
remove
- Parameters:
action
- the action to remove- Returns:
- this Controls instance
-
removeAll
Controls removeAll()Removes all actions from this controls instance- Returns:
- this Controls instance
-
size
int size()- Returns:
- the number of controls in this controls instance
-
empty
boolean empty()- Returns:
- true if this controls instance contains no controls (ignoring separators)
-
notEmpty
boolean notEmpty()- Returns:
- true if this controls instance contains controls (ignoring separators)
-
get
- Parameters:
index
- the index- Returns:
- the action at the given index
-
add
- Parameters:
controls
- the controls to add- Returns:
- this Control instance
-
addAt
- Parameters:
index
- the indexcontrols
- the controls to add at the specified index- Returns:
- this Controls instance
-
addSeparator
Controls addSeparator()Adds a separator to the end of this controls instance- Returns:
- this Controls instance
-
addSeparatorAt
Adds a separator at the given index- Parameters:
index
- the index- Returns:
- this Controls instance
-
addAll
Adds all actions found incontrols
to this controls instance- Parameters:
controls
- the source list- Returns:
- this Controls instance
-
controls
Constructs a new Controls instance.- Returns:
- a new Controls instance.
-
controls
Constructs a new Controls instance.- Parameters:
actions
- the actions- Returns:
- a new Controls instance.
-
controls
Constructs a new Controls instance.- Parameters:
controls
- the controls- Returns:
- a new Controls instance.
-
builder
- Returns:
- a new Controls.Builder instance
-