Interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>

Type Parameters:
C - the Control type
B - the builder type
All Known Subinterfaces:
CommandControl.CommandControlBuilder, Controls.ControlsBuilder, ToggleControl.ToggleControlBuilder
Enclosing interface:
Control

public static interface Control.Builder<C extends Control,B extends Control.Builder<C,B>>
A builder for Control
  • Method Details

    • name

      B name(String name)
      Parameters:
      name - the name of the control
      Returns:
      this Builder instance
    • enabled

      B enabled(StateObserver enabled)
      Parameters:
      enabled - the state observer which controls the enabled state of the control
      Returns:
      this Builder instance
    • mnemonic

      B mnemonic(int mnemonic)
      Parameters:
      mnemonic - the control mnemonic
      Returns:
      this Builder instance
    • smallIcon

      B smallIcon(Icon smallIcon)
      Parameters:
      smallIcon - the small control icon
      Returns:
      this Builder instance
    • largeIcon

      B largeIcon(Icon largeIcon)
      Parameters:
      largeIcon - the large control icon
      Returns:
      this Builder instance
    • description

      B description(String description)
      Parameters:
      description - a string describing the control
      Returns:
      this Builder instance
    • foreground

      B foreground(Color foreground)
      Parameters:
      foreground - the foreground color
      Returns:
      this Builder instance
    • background

      B background(Color background)
      Parameters:
      background - the background color
      Returns:
      this Builder instance
    • font

      B font(Font font)
      Parameters:
      font - the font
      Returns:
      this Builder instance
    • keyStroke

      B keyStroke(KeyStroke keyStroke)
      Parameters:
      keyStroke - the keystroke to associate with the control
      Returns:
      this Builder instance
    • value

      B value(String key, Object value)
      Note that any values added will overwrite the property, if already present, i.e. setting the 'SmallIcon' value via this method will overwrite the one set via smallIcon(Icon).
      Parameters:
      key - the key
      value - the value
      Returns:
      this builder
      See Also:
    • build

      C build()
      Returns:
      a new Control instance
      Throws:
      IllegalStateException - in case no command has been set