-
- All Superinterfaces:
Action
,ActionListener
,Control
,EventListener
public interface Controls extends Control
A collection of controls and separators, note that these can be nested controls.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Controls.Builder
A builder for Controls-
Nested classes/interfaces inherited from interface is.codion.swing.common.ui.control.Control
Control.ActionCommand, 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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Action>
actions()
Controls
add(Controls controls)
Controls
add(Action action)
Adds the given action to this Controls instance, adding a null action has the same effect as addSeparator()Controls
addAll(Controls controls)
Adds all actions found incontrols
to this controls instanceControls
addAt(int index, Controls controls)
Controls
addAt(int index, Action action)
Adds the given action to this Controls instance at the specified index, adding a null action has the same effect as addSeparator()Controls
addSeparator()
Adds a separator to the end of this controls instanceControls
addSeparatorAt(int index)
Adds a separator at the given indexstatic Controls.Builder
builder()
static Controls
controls()
Constructs a new Controls instance.static Controls
controls(Control... controls)
Constructs a new Controls instance.JPanel
createHorizontalButtonPanel()
Creates a horizontally laid out panel of buttons from this controls instanceJToolBar
createHorizontalToolBar()
Creates a JToolBar populated with these controls.JMenu
createMenu()
Creates a menu from this controls instanceJMenuBar
createMenuBar()
JPopupMenu
createPopupMenu()
Creates a popup menu from this controls instanceJPanel
createVerticalButtonPanel()
Creates a vertically laid out panel of buttons from this controls instanceJToolBar
createVerticalToolBar()
Creates a JToolBar populated with these controls.Action
get(int index)
boolean
isEmpty()
Controls
remove(Action action)
Controls
removeAll()
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
createButton, createMenuItem, enabledObserver, getBackground, getCaption, getDescription, getFont, getForeground, getKeyStroke, getLargeIcon, getMnemonic, getSmallIcon, setBackground, setCaption, setDescription, setEnabled, setFont, setForeground, setKeyStroke, setLargeIcon, setMnemonic, setSmallIcon
-
-
-
-
Method Detail
-
add
Controls add(Action action)
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
Controls addAt(int index, Action action)
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
Controls remove(Action action)
- 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
-
isEmpty
boolean isEmpty()
- Returns:
- true if this controls instance contains no controls
-
get
Action get(int index)
- Parameters:
index
- the index- Returns:
- the action at the given index
-
add
Controls add(Controls controls)
- Parameters:
controls
- the controls to add- Returns:
- this Control instance
-
addAt
Controls addAt(int index, Controls controls)
- 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
Controls addSeparatorAt(int index)
Adds a separator at the given index- Parameters:
index
- the index- Returns:
- this Controls instance
-
addAll
Controls addAll(Controls controls)
Adds all actions found incontrols
to this controls instance- Parameters:
controls
- the source list- Returns:
- this Controls instance
-
createVerticalButtonPanel
JPanel createVerticalButtonPanel()
Creates a vertically laid out panel of buttons from this controls instance- Returns:
- the button panel
-
createHorizontalButtonPanel
JPanel createHorizontalButtonPanel()
Creates a horizontally laid out panel of buttons from this controls instance- Returns:
- the button panel
-
createVerticalToolBar
JToolBar createVerticalToolBar()
Creates a JToolBar populated with these controls.- Returns:
- a toolbar based on these controls
-
createHorizontalToolBar
JToolBar createHorizontalToolBar()
Creates a JToolBar populated with these controls.- Returns:
- a toolbar based on these controls
-
createPopupMenu
JPopupMenu createPopupMenu()
Creates a popup menu from this controls instance- Returns:
- a popup menu based on this controls instance
-
createMenu
JMenu createMenu()
Creates a menu from this controls instance- Returns:
- a menu based on this controls instance
-
createMenuBar
JMenuBar createMenuBar()
- Returns:
- a menu bar based on the controls instances contained in this controls instance
-
controls
static Controls controls()
Constructs a new Controls instance.- Returns:
- a new Controls instance.
-
controls
static Controls controls(Control... controls)
Constructs a new Controls instance.- Parameters:
controls
- the controls- Returns:
- a new Controls instance.
-
builder
static Controls.Builder builder()
- Returns:
- a new Controls.Builder instance
-
-