Module is.codion.swing.common.ui
Interface Controls.Layout
- Enclosing interface:
Controls
public static interface Controls.Layout
Specifies a layout for a
Controls instance.
Controls and separators are added at the insertion point, which follows each one added. It is at the end of the
layout, unless moved via after(ControlKey) or before(ControlKey). The defaults are always added
at the end, via defaults() and defaults(ControlKey), the insertion point left where it is.
-
Method Summary
Modifier and TypeMethodDescriptionafter(ControlKey<?> controlKey) Moves the insertion point to right after the given control, one of this layout, not of a nested one, or to the end in case it is not in this layout.before(ControlKey<?> controlKey) Moves the insertion point to right before the given control, one of this layout, not of a nested one, or to the end in case it is not in this layout.clear()Clears all controls from this layout, moving the insertion point to the endcontrol(ControlKey<?> controlKey) Adds a standard control, or a separator in case ofControlKey.SEPARATORcontrols(ControlKey<Controls> controlsKey) Adds standard controlscontrols(Controls.ControlsKey controlsKey, Consumer<Controls.Layout> layout) Configures the standard controls identified by the given key, in place where already in this layout, otherwise added.copy()create(ControlMap controlMap) defaults()Adds all remaining default controlsdefaults(ControlKey<?> stopAt) Adds all remaining default controls, up until and includingstopAtremove(ControlKey<?> controlKey) Removes the given control from this layout, one of this layout, not of a nested one, the layout left as it is in case it is not in this layout.Adds a separator
-
Method Details
-
separator
Controls.Layout separator()Adds a separator- Returns:
- this layout instance
-
control
Adds a standard control, or a separator in case ofControlKey.SEPARATOR- Parameters:
controlKey- the key identifying the standard control to add- Returns:
- this layout instance
-
control
- Parameters:
control- the control to add- Returns:
- this layout instance
-
control
- Parameters:
control- the control to add- Returns:
- this layout instance
-
controls
Adds standard controls- Parameters:
controlsKey- the key identifying the standard controls to add- Returns:
- this layout instance
-
controls
Configures the standard controls identified by the given key, in place where already in this layout, otherwise added. The consumer receives the layout configured so far, a copy of the key's default layout to begin with.- Parameters:
controlsKey- the controls keylayout- configures the controls layout- Returns:
- this layout instance
- Throws:
IllegalArgumentException- in casecontrolsKeydoes not provide a default layout
-
action
- Parameters:
action- the Action to add- Returns:
- this layout instance
-
defaults
Controls.Layout defaults()Adds all remaining default controls- Returns:
- this layout instance
-
defaults
Adds all remaining default controls, up until and includingstopAt- Parameters:
stopAt- the standard control to stop at (inclusive),ControlKey.SEPARATORstopping at the first separator in the defaults- Returns:
- this layout instance
-
after
Moves the insertion point to right after the given control, one of this layout, not of a nested one, or to the end in case it is not in this layout.- Parameters:
controlKey- the key identifying the control to add after- Returns:
- this layout instance
- Throws:
IllegalArgumentException- in case ofControlKey.SEPARATOR, not an anchor
-
before
Moves the insertion point to right before the given control, one of this layout, not of a nested one, or to the end in case it is not in this layout.- Parameters:
controlKey- the key identifying the control to add before- Returns:
- this layout instance
- Throws:
IllegalArgumentException- in case ofControlKey.SEPARATOR, not an anchor
-
remove
Removes the given control from this layout, one of this layout, not of a nested one, the layout left as it is in case it is not in this layout. The insertion point stays where it is among the remaining controls. Note thatdefaults()adds a default control removed again.- Parameters:
controlKey- the key identifying the control to remove- Returns:
- this layout instance
- Throws:
IllegalArgumentException- in case ofControlKey.SEPARATOR
-
clear
Controls.Layout clear()Clears all controls from this layout, moving the insertion point to the end- Returns:
- this layout instance
-
copy
Controls.Layout copy()- Returns:
- a copy of this
Controls.Layoutas configured, the layouts of configured controls copied as well, its insertion point at the end
-
create
- Parameters:
controlMap- provides the standard controls- Returns:
- a
Controlsinstance based on this layout
-