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 Details

    • separator

      Controls.Layout separator()
      Adds a separator
      Returns:
      this layout instance
    • control

      Controls.Layout control(ControlKey<?> controlKey)
      Adds a standard control, or a separator in case of ControlKey.SEPARATOR
      Parameters:
      controlKey - the key identifying the standard control to add
      Returns:
      this layout instance
    • control

      Controls.Layout control(Control control)
      Parameters:
      control - the control to add
      Returns:
      this layout instance
    • control

      Controls.Layout control(Supplier<? extends Control> control)
      Parameters:
      control - the control to add
      Returns:
      this layout instance
    • controls

      Controls.Layout controls(ControlKey<Controls> controlsKey)
      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 key
      layout - configures the controls layout
      Returns:
      this layout instance
      Throws:
      IllegalArgumentException - in case controlsKey does not provide a default layout
    • action

      Controls.Layout action(Action 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

      Controls.Layout defaults(ControlKey<?> stopAt)
      Adds all remaining default controls, up until and including stopAt
      Parameters:
      stopAt - the standard control to stop at (inclusive), ControlKey.SEPARATOR stopping at the first separator in the defaults
      Returns:
      this layout instance
    • after

      Controls.Layout after(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.
      Parameters:
      controlKey - the key identifying the control to add after
      Returns:
      this layout instance
      Throws:
      IllegalArgumentException - in case of ControlKey.SEPARATOR, not an anchor
    • before

      Controls.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.
      Parameters:
      controlKey - the key identifying the control to add before
      Returns:
      this layout instance
      Throws:
      IllegalArgumentException - in case of ControlKey.SEPARATOR, not an anchor
    • remove

      Controls.Layout remove(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. The insertion point stays where it is among the remaining controls. Note that defaults() adds a default control removed again.
      Parameters:
      controlKey - the key identifying the control to remove
      Returns:
      this layout instance
      Throws:
      IllegalArgumentException - in case of ControlKey.SEPARATOR
    • clear

      Clears all controls from this layout, moving the insertion point to the end
      Returns:
      this layout instance
    • copy

      Returns:
      a copy of this Controls.Layout as configured, the layouts of configured controls copied as well, its insertion point at the end
    • create

      Controls create(ControlMap controlMap)
      Parameters:
      controlMap - provides the standard controls
      Returns:
      a Controls instance based on this layout